Skip to content

Commit

Permalink
feat: bump playwright to 1.40.1 and update formatter (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam authored Dec 6, 2023
1 parent d33d899 commit d01c3fd
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion __tests__/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('options', () => {
ignoreHTTPSErrors: undefined,
isMobile: true,
userAgent:
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.62 Mobile Safari/537.36',
'Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.28 Mobile Safari/537.36',
viewport: {
height: 658,
width: 320,
Expand Down
16 changes: 8 additions & 8 deletions bundles/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"build": "npm run bundle -- --minify"
},
"dependencies": {
"playwright": "=1.38.1"
"playwright": "=1.40.1"
}
}
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"kleur": "^4.1.5",
"micromatch": "^4.0.5",
"pirates": "^4.0.5",
"playwright": "=1.38.1",
"playwright-chromium": "=1.38.1",
"playwright-core": "=1.38.1",
"playwright": "=1.40.1",
"playwright-chromium": "=1.40.1",
"playwright-core": "=1.40.1",
"semver": "^7.5.4",
"sharp": "^0.32.6",
"snakecase-keys": "^4.0.1",
Expand Down
13 changes: 2 additions & 11 deletions src/formatter/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,15 @@ function toAssertCall(pageAlias: string, action: Action) {
}

function toSignalMap(action: Action) {
let waitForNavigation: Signal | undefined;
let assertNavigation: Signal | undefined;
let popup: Signal | undefined;
let download: Signal | undefined;
let dialog: Signal | undefined;
for (const signal of action.signals) {
if (signal.name === 'navigation' && signal.isAsync)
waitForNavigation = signal;
else if (signal.name === 'navigation' && !signal.isAsync)
assertNavigation = signal;
else if (signal.name === 'popup') popup = signal;
if (signal.name === 'popup') popup = signal;
else if (signal.name === 'download') download = signal;
else if (signal.name === 'dialog') dialog = signal;
}
return {
waitForNavigation,
assertNavigation,
popup,
download,
dialog,
Expand Down Expand Up @@ -280,8 +272,7 @@ export class SyntheticsGenerator extends JavaScriptLanguageGenerator {
if (isAssert && action.command) {
formatter.add(toAssertCall(pageAlias, action));
} else {
const actionCall = super._generateActionCall(action);
formatter.add(`await ${subject}.${actionCall};`);
formatter.add(super._generateActionCall(subject, action));
}

if (signals.popup)
Expand Down

0 comments on commit d01c3fd

Please sign in to comment.