Skip to content

Commit

Permalink
test(playwright-ct): tweak timouts and meta key
Browse files Browse the repository at this point in the history
  • Loading branch information
skogsmaskin committed Dec 11, 2024
1 parent b365756 commit 042ba35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/sanity/playwright-ct.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export default defineConfig({
],

/* Maximum time one test can run for. */
timeout: 30 * 1000,
timeout: 60 * 1000,
expect: {
// Maximum time expect() should wait for the condition to be met.
timeout: 10 * 1000,
timeout: 40 * 1000,
},

/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
Expand Down
15 changes: 8 additions & 7 deletions packages/sanity/playwright-ct/tests/utils/testHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,15 @@ export function testHelpers({page}: {page: PlaywrightTestArgs['page']}) {
* @returns The modifier key name ('Meta' for macOS, 'Control' for other platforms).
*/
getModifierKey: (options?: {browserName?: string}) => {
if (process.platform === 'darwin') {
// There's a bug in Chromium on macOS where it use 'Control' instead of 'Meta' inside Playwright for some reason
if (options?.browserName && ['chromium', 'firefox'].includes(options.browserName)) {
return 'Control'
}
return 'Meta'
// There's a bug with Firefox and Chromium on macOS where it use 'Control' instead of 'Meta' inside Playwright for some reason
if (
process.platform === 'darwin' &&
options?.browserName &&
['chromium', 'firefox'].includes(options.browserName)
) {
return 'Control'
}
return 'Control'
return 'ControlOrMeta'
},
/**
* Types text with a delay using `page.keyboard.type`. Default delay emulates a human typing.
Expand Down

0 comments on commit 042ba35

Please sign in to comment.