Skip to content

Commit

Permalink
Bug 1607562 - [remote] Update puppeteer unit tests and expectation da…
Browse files Browse the repository at this point in the history
…ta. r=remote-protocol-reviewers,maja_zf

Differential Revision: https://phabricator.services.mozilla.com/D68638
  • Loading branch information
whimboo committed Mar 31, 2020
1 parent 4cef4bc commit bb0eb18
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 67 deletions.
74 changes: 37 additions & 37 deletions remote/puppeteer-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"PASS"
],
"Firefox Browser Page Page.emulate should support clicking": [
"PASS"
"PASS", "FAIL"
],
"Firefox Browser Page Page.emulateMedia should be an alias for Page.emulateMediaType": [
"PASS"
Expand Down Expand Up @@ -397,10 +397,10 @@
"PASS"
],
"Firefox Browser Page Page.evaluate should return undefined for non-serializable objects": [
"SKIP"
"FAIL"
],
"Firefox Browser Page Page.evaluate should fail for circular object": [
"SKIP"
"FAIL"
],
"Firefox Browser Page Page.evaluate should be able to throw a tricky error": [
"PASS"
Expand All @@ -427,7 +427,7 @@
"FAIL"
],
"Firefox Browser Page Page.evaluate should throw a nice error after a navigation": [
"SKIP"
"FAIL"
],
"Firefox Browser Page Page.evaluate should not throw an error when evaluation does a navigation": [
"PASS"
Expand Down Expand Up @@ -613,7 +613,7 @@
"PASS"
],
"Firefox Browser Page Keyboard should press the metaKey": [
"FAIL"
"PASS"
],
"Firefox Browser Page Keyboard should move with the arrow keys": [
"PASS"
Expand All @@ -628,7 +628,7 @@
"FAIL"
],
"Firefox Browser Page Keyboard should report shiftKey": [
"PASS"
"PASS", "FAIL"
],
"Firefox Browser Page Keyboard should report multiple modifiers": [
"PASS"
Expand Down Expand Up @@ -661,7 +661,7 @@
"FAIL"
],
"Firefox Browser Page Keyboard should press the meta key": [
"FAIL"
"PASS"
],
"Firefox Browser Page Mouse should click the document": [
"PASS"
Expand Down Expand Up @@ -829,7 +829,7 @@
"FAIL"
],
"Firefox Browser Page Frame.goto should return matching responses": [
"FAIL"
"SKIP"
],
"Firefox Browser Page Frame.waitForNavigation should work": [
"FAIL"
Expand All @@ -844,7 +844,7 @@
"PASS"
],
"Firefox Browser Page Page.Events.Request should fire for iframes": [
"FAIL"
"PASS"
],
"Firefox Browser Page Page.Events.Request should fire for fetches": [
"PASS"
Expand Down Expand Up @@ -1243,7 +1243,7 @@
"PASS"
],
"Firefox Browser Page Page.setUserAgent should work for subframes": [
"FAIL"
"PASS"
],
"Firefox Browser Page Page.setUserAgent should emulate device user-agent": [
"PASS"
Expand All @@ -1258,13 +1258,13 @@
"PASS"
],
"Firefox Browser Page Page.setContent should respect timeout": [
"PASS"
"PASS", "FAIL"
],
"Firefox Browser Page Page.setContent should respect default navigation timeout": [
"PASS"
"PASS", "FAIL"
],
"Firefox Browser Page Page.setContent should await resources to load": [
"PASS"
"PASS", "FAIL"
],
"Firefox Browser Page Page.setContent should work fast enough": [
"PASS"
Expand Down Expand Up @@ -1600,10 +1600,10 @@
"FAIL"
],
"Firefox Browser Page Page.waitFor should wait for selector": [
"FAIL"
"PASS"
],
"Firefox Browser Page Page.waitFor should wait for an xpath": [
"SKIP"
"PASS"
],
"Firefox Browser Page Page.waitFor should not allow you to select an element with single slash xpath": [
"PASS"
Expand Down Expand Up @@ -1672,64 +1672,64 @@
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should immediately resolve promise if node exists": [
"FAIL"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should work with removed MutationObserver": [
"FAIL"
],
"Firefox Browser Page Frame.waitForSelector should resolve promise when node is added": [
"FAIL"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should work when node is added through innerHTML": [
"FAIL"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector Page.waitForSelector is shortcut for main frame": [
"FAIL"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should run in specified frame": [
"FAIL"
"PASS", "FAIL"
],
"Firefox Browser Page Frame.waitForSelector should throw when frame is detached": [
"FAIL"
"PASS", "FAIL"
],
"Firefox Browser Page Frame.waitForSelector should survive cross-process navigation": [
"FAIL"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should wait for visible": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should wait for visible recursively": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector hidden should wait for visibility: hidden": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector hidden should wait for display: none": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector hidden should wait for removal": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should return null if waiting to hide non-existing element": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should respect timeout": [
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should have an error message specifically for awaiting an element to be hidden": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should respond to node attribute mutation": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should return the element handle": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForSelector should have correct stack trace for timeout": [
"PASS"
],
"Firefox Browser Page Frame.waitForXPath should support some fancy xpath": [
"FAIL"
"PASS"
],
"Firefox Browser Page Frame.waitForXPath should respect timeout": [
"PASS"
Expand All @@ -1741,16 +1741,16 @@
"FAIL"
],
"Firefox Browser Page Frame.waitForXPath hidden should wait for display: none": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForXPath should return the element handle": [
"SKIP"
"PASS"
],
"Firefox Browser Page Frame.waitForXPath should allow you to select a text node": [
"FAIL"
"PASS"
],
"Firefox Browser Page Frame.waitForXPath should allow you to select an element with single slash": [
"FAIL"
"PASS"
],
"Firefox Browser Page Workers Page.workers": [
"SKIP"
Expand Down Expand Up @@ -1786,7 +1786,7 @@
"FAIL"
],
"Firefox Browser BrowserContext should wait for a target": [
"TIMEOUT"
"SKIP"
],
"Firefox Browser BrowserContext should timeout waiting for a non-existent target": [
"PASS"
Expand Down
2 changes: 1 addition & 1 deletion remote/test/puppeteer/test/browsercontext.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports.addTests = function({testRunner, expect, puppeteer}) {
]);
await context.close();
});
it('should wait for a target', async function({browser, server}) {
it_fails_ffox('should wait for a target', async function({browser, server}) {
const context = await browser.createIncognitoBrowserContext();
let resolved = false;
const targetPromise = context.waitForTarget(target => target.url() === server.EMPTY_PAGE);
Expand Down
1 change: 1 addition & 0 deletions remote/test/puppeteer/test/emulation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ module.exports.addTests = function({testRunner, expect, puppeteer}) {
it('should support clicking', async({page, server}) => {
await page.emulate(iPhone);
await page.goto(server.PREFIX + '/input/button.html');

const button = await page.$('button');
await page.evaluate(button => button.style.marginTop = '200px', button);
await button.click();
Expand Down
6 changes: 3 additions & 3 deletions remote/test/puppeteer/test/evaluation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ module.exports.addTests = function({testRunner, expect}) {
it('should properly serialize null fields', async({page}) => {
expect(await page.evaluate(() => ({a: undefined}))).toEqual({});
});
it_fails_ffox('should return undefined for non-serializable objects', async({page, server}) => {
it('should return undefined for non-serializable objects', async({page, server}) => {
expect(await page.evaluate(() => window)).toBe(undefined);
});
it_fails_ffox('should fail for circular object', async({page, server}) => {
it('should fail for circular object', async({page, server}) => {
const result = await page.evaluate(() => {
const a = {};
const b = {a};
Expand Down Expand Up @@ -224,7 +224,7 @@ module.exports.addTests = function({testRunner, expect}) {
});
expect(result).toBe(true);
});
it_fails_ffox('should throw a nice error after a navigation', async({page, server}) => {
it('should throw a nice error after a navigation', async({page, server}) => {
const executionContext = await page.mainFrame().executionContext();

await Promise.all([
Expand Down
21 changes: 9 additions & 12 deletions remote/test/puppeteer/test/keyboard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports.addTests = function({testRunner, expect, FFOX}) {
window.keyPromise = new Promise(resolve => document.addEventListener('keydown', event => resolve(event.key)));
});
await page.keyboard.press('Meta');
expect(await page.evaluate('keyPromise')).toBe(FFOX && os.platform() !== 'darwin' ? 'OS' : 'Meta');
expect(await page.evaluate('keyPromise')).toBe('Meta');
});
it('should move with the arrow keys', async({page, server}) => {
await page.goto(server.PREFIX + '/input/textarea.html');
Expand Down Expand Up @@ -234,21 +234,18 @@ module.exports.addTests = function({testRunner, expect, FFOX}) {
});
await page.keyboard.press('Meta');
const [key, code, metaKey] = await page.evaluate('result');
if (FFOX && os.platform() !== 'darwin')
expect(key).toBe('OS');
else
expect(key).toBe('Meta');
expect(key).toBe('Meta');

if (FFOX)
expect(code).toBe('OSLeft');
if (FFOX) {
if (os.platform() !== 'darwin')
expect(code).toBe('AltLeft');
else
expect(code).toBe('OSLeft');
}
else
expect(code).toBe('MetaLeft');

if (FFOX && os.platform() !== 'darwin')
expect(metaKey).toBe(false);
else
expect(metaKey).toBe(true);

expect(metaKey).toBe(true);
});
});
};
2 changes: 1 addition & 1 deletion remote/test/puppeteer/test/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ module.exports.addTests = function({testRunner, expect, puppeteer, CHROME}) {
const error = await navigationPromise;
expect(error.message).toBe('Navigating frame was detached');
});
it('should return matching responses', async({page, server}) => {
it_fails_ffox('should return matching responses', async({page, server}) => {
// Disable cache: otherwise, chromium will cache similar requests.
await page.setCacheEnabled(false);
await page.goto(server.EMPTY_PAGE);
Expand Down
Loading

0 comments on commit bb0eb18

Please sign in to comment.