fix(webdriver): frame url should not be updated on navigationStarted (#12536)

This commit is contained in:
Alex Rudenko 2024-06-05 09:03:56 +02:00 committed by GitHub
parent 88df407517
commit 7d0423b12c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 35 deletions

View File

@ -219,7 +219,8 @@ export class BrowsingContext extends EventEmitter<{
if (info.context !== this.id) {
return;
}
this.#url = info.url;
// Note: we should not update this.#url at this point since the context
// has not finished navigating to the info.url yet.
for (const [id, request] of this.#requests) {
if (request.disposed) {

View File

@ -744,13 +744,6 @@
"expectations": ["FAIL"],
"comment": "`HTTPRequest.resourceType()` has no eqivalent in BiDi spec"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should intercept",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "`request.postData()` has no eqivalent in BiDi spec"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should navigate to URL with hash and fire requests without hash",
"platforms": ["darwin", "linux", "win32"],
@ -3196,13 +3189,6 @@
"expectations": ["SKIP"],
"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",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: Needs Puppeteer support for BidiHTTPRequest.postData"
},
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should load fonts if cache enabled",
"platforms": ["darwin", "linux", "win32"],
@ -3307,13 +3293,6 @@
"expectations": ["SKIP"],
"comment": "TODO: Needs support for enabling cache in BiDi without CDP https://github.com/w3c/webdriver-bidi/issues/582"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should intercept",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: Needs Puppeteer support for BidiHTTPRequest.postData"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should load fonts if cache enabled",
"platforms": ["darwin", "linux", "win32"],
@ -3753,13 +3732,6 @@
"expectations": ["FAIL"],
"comment": "`HTTPRequest.resourceType()` has no eqivalent in BiDi spec"
},
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should intercept",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "headless", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "`request.postData()` has no eqivalent in BiDi spec"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should be abortable",
"platforms": ["darwin", "linux", "win32"],

View File

@ -104,10 +104,9 @@ describe('cooperative request interception', function () {
expect(request.url()).toContain('empty.html');
expect(request.headers()['user-agent']).toBeTruthy();
expect(request.method()).toBe('GET');
expect(request.postData()).toBe(undefined);
expect(request.isNavigationRequest()).toBe(true);
expect(request.frame()!.url()).toBe('about:blank');
expect(request.frame() === page.mainFrame()).toBe(true);
expect(request.frame()!.url()).toBe('about:blank');
} catch (error) {
requestError = error;
} finally {
@ -121,7 +120,6 @@ describe('cooperative request interception', function () {
}
expect(response.ok()).toBe(true);
expect(response.remoteAddress().port).toBe(server.PORT);
});
// @see https://github.com/puppeteer/puppeteer/pull/3105
it('should work when POST is redirected with 302', async () => {

View File

@ -33,10 +33,9 @@ describe('request interception', function () {
expect(request.url()).toContain('empty.html');
expect(request.headers()['user-agent']).toBeTruthy();
expect(request.method()).toBe('GET');
expect(request.postData()).toBe(undefined);
expect(request.isNavigationRequest()).toBe(true);
expect(request.frame()!.url()).toBe('about:blank');
expect(request.frame() === page.mainFrame()).toBe(true);
expect(request.frame()!.url()).toBe('about:blank');
} catch (error) {
requestError = error;
} finally {
@ -50,7 +49,6 @@ describe('request interception', function () {
}
expect(response.ok()).toBe(true);
expect(response.remoteAddress().port).toBe(server.PORT);
});
// @see https://github.com/puppeteer/puppeteer/pull/3105
it('should work when POST is redirected with 302', async () => {