mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
test: fix chromium tests (#155)
3 chromium tests were failing on Linux.
This commit is contained in:
parent
51ca756efe
commit
929a5944bd
@ -14,7 +14,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const utils = require('./utils');
|
const {waitEvent} = require('./utils');
|
||||||
|
const util = require('util');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const os = require('os');
|
||||||
|
const rmAsync = util.promisify(require('rimraf'));
|
||||||
|
const mkdtempAsync = util.promisify(fs.mkdtemp);
|
||||||
|
|
||||||
|
const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
|
||||||
|
|
||||||
module.exports.addLauncherTests = function({testRunner, expect, defaultBrowserOptions, playwright}) {
|
module.exports.addLauncherTests = function({testRunner, expect, defaultBrowserOptions, playwright}) {
|
||||||
const {describe, xdescribe, fdescribe} = testRunner;
|
const {describe, xdescribe, fdescribe} = testRunner;
|
||||||
@ -162,7 +170,7 @@ module.exports.addLauncherTests = function({testRunner, expect, defaultBrowserOp
|
|||||||
remoteBrowser2.on('disconnected', () => ++disconnectedRemote2);
|
remoteBrowser2.on('disconnected', () => ++disconnectedRemote2);
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
utils.waitEvent(remoteBrowser2, 'disconnected'),
|
waitEvent(remoteBrowser2, 'disconnected'),
|
||||||
remoteBrowser2.disconnect(),
|
remoteBrowser2.disconnect(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -171,8 +179,8 @@ module.exports.addLauncherTests = function({testRunner, expect, defaultBrowserOp
|
|||||||
expect(disconnectedRemote2).toBe(1);
|
expect(disconnectedRemote2).toBe(1);
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
utils.waitEvent(remoteBrowser1, 'disconnected'),
|
waitEvent(remoteBrowser1, 'disconnected'),
|
||||||
utils.waitEvent(originalBrowser, 'disconnected'),
|
waitEvent(originalBrowser, 'disconnected'),
|
||||||
originalBrowser.close(),
|
originalBrowser.close(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -301,6 +301,7 @@ module.exports.addTests = function({testRunner, expect, playwright, FFOX, CHROME
|
|||||||
it('should click the button with em border with relative point', async({page, server}) => {
|
it('should click the button with em border with relative point', async({page, server}) => {
|
||||||
await page.goto(server.PREFIX + '/input/button.html');
|
await page.goto(server.PREFIX + '/input/button.html');
|
||||||
await page.$eval('button', button => button.style.borderWidth = '2em');
|
await page.$eval('button', button => button.style.borderWidth = '2em');
|
||||||
|
await page.$eval('button', button => button.style.fontSize = '12px');
|
||||||
await page.click('button', { relativePoint: { x: 20, y: 10 } });
|
await page.click('button', { relativePoint: { x: 20, y: 10 } });
|
||||||
expect(await page.evaluate(() => result)).toBe('Clicked');
|
expect(await page.evaluate(() => result)).toBe('Clicked');
|
||||||
expect(await page.evaluate(() => offsetX)).toBe(20);
|
expect(await page.evaluate(() => offsetX)).toBe(20);
|
||||||
|
Loading…
Reference in New Issue
Block a user