fix(codegen): use new toHaveURL syntax (#8624)
This commit is contained in:
parent
63e9287b36
commit
0202cdf797
|
|
@ -95,7 +95,7 @@ export class JavaScriptLanguageGenerator implements LanguageGenerator {
|
|||
formatter.add(`]);`);
|
||||
} else if (signals.assertNavigation) {
|
||||
if (this._isTest)
|
||||
formatter.add(` expect(${pageAlias}.url()).toBe(${quote(signals.assertNavigation.url)});`);
|
||||
formatter.add(` await expect(${pageAlias}).toHaveURL(${quote(signals.assertNavigation.url)});`);
|
||||
else
|
||||
formatter.add(` // assert.equal(${pageAlias}.url(), ${quote(signals.assertNavigation.url)});`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -539,7 +539,7 @@ test.describe('cli codegen', () => {
|
|||
expect(sources.get('Playwright Test').text).toContain(`
|
||||
// Click text=link
|
||||
await page.click('text=link');
|
||||
expect(page.url()).toBe('about:blank#foo');`);
|
||||
await expect(page).toHaveURL('about:blank#foo');`);
|
||||
|
||||
expect(sources.get('Java').text).toContain(`
|
||||
// Click text=link
|
||||
|
|
|
|||
Loading…
Reference in a new issue