ci: enable more Firefox tests that are now passing and fix others (#12502)

This commit is contained in:
Henrik Skupin 2024-05-30 11:31:47 +02:00 committed by GitHub
parent 73529cc64e
commit bae3721e04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 34 deletions

View File

@ -120,7 +120,7 @@ export class FirefoxLauncher extends ProductLauncher {
if (profileArgIndex !== -1) { if (profileArgIndex !== -1) {
userDataDir = firefoxArguments[profileArgIndex + 1]; userDataDir = firefoxArguments[profileArgIndex + 1];
if (!userDataDir || !fs.existsSync(userDataDir)) { if (!userDataDir) {
throw new Error(`Firefox profile not found at '${userDataDir}'`); throw new Error(`Firefox profile not found at '${userDataDir}'`);
} }

View File

@ -460,13 +460,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch userDataDir argument with non-existent dir",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox"],
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{ {
"testIdPattern": "[mouse.spec] Mouse should not throw if buttons are pressed twice", "testIdPattern": "[mouse.spec] Mouse should not throw if buttons are pressed twice",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2503,14 +2496,7 @@
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "Fetch.enable not supported with CDP"
},
{
"testIdPattern": "[network.spec] network Network Events Page.Events.RequestFailed",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "Test expects slightly different error message consider changing"
}, },
{ {
"testIdPattern": "[network.spec] network Network Events Page.Events.RequestFinished", "testIdPattern": "[network.spec] network Network Events Page.Events.RequestFinished",
@ -3299,7 +3285,7 @@
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Test relies on chrome-only error code (Firefox currently outputs NS_ERROR_ABORT)" "comment": "TODO: BiDi does not support custom errors - https://github.com/w3c/webdriver-bidi/issues/508"
}, },
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should cache if cache enabled", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should cache if cache enabled",
@ -3308,19 +3294,12 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs support for enabling cache in BiDi without CDP https://github.com/w3c/webdriver-bidi/issues/582" "comment": "TODO: Needs support for enabling cache in BiDi without CDP https://github.com/w3c/webdriver-bidi/issues/582"
}, },
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should cooperatively continue by priority",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: Needs full support for continueRequest in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1850680"
},
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should cooperatively respond by priority", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should cooperatively respond by priority",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs full support for continueRequest in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1850680" "comment": "TODO: Needs support for arguments in network.provideResponse in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1853882"
}, },
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should intercept", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should intercept",
@ -3438,7 +3417,7 @@
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Test relies on chrome-only error code (Firefox currently outputs NS_ERROR_ABORT)" "comment": "TODO: BiDi does not support custom errors - https://github.com/w3c/webdriver-bidi/issues/508"
}, },
{ {
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should cache if cache enabled", "testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should cache if cache enabled",

View File

@ -976,19 +976,23 @@ describe('Launcher specs', function () {
try { try {
const events: string[] = []; const events: string[] = [];
browser.on('targetcreated', () => { browser.on('targetcreated', target => {
events.push('CREATED'); events.push('CREATED: ' + target.url());
}); });
browser.on('targetchanged', () => { browser.on('targetchanged', target => {
events.push('CHANGED'); events.push('CHANGED: ' + target.url());
}); });
browser.on('targetdestroyed', () => { browser.on('targetdestroyed', target => {
events.push('DESTROYED'); events.push('DESTROYED: ' + target.url());
}); });
const page = await browser.newPage(); const page = await browser.newPage();
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);
await page.close(); await page.close();
expect(events).toEqual(['CREATED', 'CHANGED', 'DESTROYED']); expect(events).toEqual([
'CREATED: about:blank',
`CHANGED: ${server.EMPTY_PAGE}`,
`DESTROYED: ${server.EMPTY_PAGE}`,
]);
} finally { } finally {
await close(); await close();
} }

View File

@ -555,7 +555,7 @@ describe('network', function () {
if (isChrome) { if (isChrome) {
expect(failedRequest.failure()!.errorText).toBe('net::ERR_FAILED'); expect(failedRequest.failure()!.errorText).toBe('net::ERR_FAILED');
} else { } else {
expect(failedRequest.failure()!.errorText).toBe('NS_ERROR_FAILURE'); expect(failedRequest.failure()!.errorText).toBe('NS_ERROR_ABORT');
} }
}); });
it('Page.Events.RequestFinished', async () => { it('Page.Events.RequestFinished', async () => {