Skip to content

Commit c05ccfe

Browse files
fix: update to the latest playwright (#485)
* fix: update to the latest playwright * add formatter code back * readd formatter exports
1 parent c500e52 commit c05ccfe

File tree

8 files changed

+173
-35
lines changed

8 files changed

+173
-35
lines changed

__tests__/formatter/__snapshots__/javascript.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ journey('Recorded journey', async ({ page, context }) => {
1515
expect(await page.textContent('text=Babel Minify')).toMatch('Babel');
1616
const [page1] = await Promise.all([
1717
page.waitForEvent('popup'),
18-
page.click('text=Babel Minify')
18+
page.locator('text=Babel Minify').click()
1919
]);
2020
await Promise.all([
2121
page1.waitForNavigation(/*{ url: 'https://github.com/babel/minify' }*/),
22-
page1.click('a:has-text(\\"smoke\\")')
22+
page1.locator('a:has-text(\\"smoke\\")').click()
2323
]);
2424
});
2525
step('Close page', async () => {

__tests__/options.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('options', () => {
6363
ignoreHTTPSErrors: undefined,
6464
isMobile: true,
6565
userAgent:
66-
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4595.0 Mobile Safari/537.36',
66+
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4929.0 Mobile Safari/537.36',
6767
viewport: {
6868
height: 658,
6969
width: 320,

package-lock.json

Lines changed: 163 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"http-proxy": "^1.18.1",
4646
"kleur": "^4.1.4",
4747
"micromatch": "^4.0.4",
48-
"playwright-chromium": "=1.14.0",
48+
"playwright-chromium": "^1.20.1",
49+
"playwright-core": "^1.20.1",
4950
"sharp": "^0.30.1",
5051
"snakecase-keys": "^3.2.1",
5152
"sonic-boom": "^2.6.0",

src/common_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
ChromiumBrowserContext,
3232
Page,
3333
} from 'playwright-chromium';
34-
import { Protocol } from 'playwright-chromium/types/protocol';
34+
import { Protocol } from 'playwright-core/types/protocol';
3535
import { Step } from './dsl';
3636
import { Reporter, reporters } from './reporters';
3737

src/formatter/javascript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import {
2727
JavaScriptLanguageGenerator,
2828
JavaScriptFormatter,
29-
} from 'playwright-chromium/lib/server/supplements/recorder/javascript';
29+
} from 'playwright-core/lib/server/supplements/recorder/javascript';
3030

3131
export type Step = {
3232
actions: ActionInContext[];

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ export type {
5959
Signal,
6060
Step,
6161
Steps,
62+
actionTitle,
6263
} from './formatter/javascript';
63-
export { actionTitle } from './formatter/javascript';

src/plugins/network.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
*/
2525

26-
import { Protocol } from 'playwright-chromium/types/protocol';
26+
import { Protocol } from 'playwright-core/types/protocol';
2727
import { NetworkInfo, BrowserInfo, Driver } from '../common_types';
2828
import { Step } from '../dsl';
2929
import { getTimestamp } from '../helpers';
@@ -87,6 +87,7 @@ export class NetworkManager {
8787
type: event.type,
8888
response,
8989
encodedDataLength: response.encodedDataLength,
90+
hasExtraInfo: false,
9091
});
9192
this._onResponseReceived(data);
9293
this._onLoadingFinished(data);

0 commit comments

Comments
 (0)