Skip to content

Commit

Permalink
Merge pull request #981 from AfolabiOlaoluwa/test-framework-fixes
Browse files Browse the repository at this point in the history
fix: Resolve issues with timeouts and target closures in test framework
  • Loading branch information
Alberto Fernández-Capel authored Sep 8, 2023
2 parents 9f3aad7 + bc2e9cb commit ae6329a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
17 changes: 14 additions & 3 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ const config = {
projects: [
{
name: "chrome",
use: { ...devices["Desktop Chrome"] }
use: {
...devices["Desktop Chrome"],
contextOptions: {
timeout: 60000
}
}
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] }
use: {
...devices["Desktop Firefox"],
contextOptions: {
timeout: 60000
}
}
}
],
browserStartTimeout: 60000,
retries: 2,
testDir: "./src/tests/",
testMatch: /(functional|integration)\/.*_tests\.js/,
Expand All @@ -26,4 +37,4 @@ const config = {
}
}

export default config
export default config
30 changes: 23 additions & 7 deletions web-test-runner.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { esbuildPlugin } from '@web/dev-server-esbuild'
import { playwrightLauncher } from '@web/test-runner-playwright'

/** @type {import("@web/test-runner").TestRunnerConfig} */
export default {
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' }),
playwrightLauncher({
product: 'chromium',
launchOptions: {
timeout: 60000
}
}),
playwrightLauncher({
product: 'firefox',
launchOptions: {
timeout: 60000
}
}),
playwrightLauncher({
product: 'webkit',
launchOptions: {
timeout: 60000
}
})
],
browserStartTimeout: 600000,
nodeResolve: true,
files: "./src/tests/unit/**/*_tests.js",
testFramework: {
Expand All @@ -17,5 +33,5 @@ export default {
},
plugins: [
esbuildPlugin({ ts: true, target: "es2020" })
],
};
]
}

0 comments on commit ae6329a

Please sign in to comment.