@@ -8,44 +8,24 @@ const path = require("path");
88 */
99// require('dotenv').config();
1010
11- /**
12- * @see https://playwright.dev/docs/test-configuration
13- */
14- module . exports = defineConfig ( {
15- testDir : "." ,
16- /* Run tests in files in parallel */
17- fullyParallel : true ,
18- /* Fail the build on CI if you accidentally left test.only in the source code. */
19- forbidOnly : ! ! process . env . CI ,
20- /* Retry on CI only */
21- retries : process . env . CI ? 2 : 0 ,
22- /* Opt out of parallel tests on CI. */
23- workers : process . env . CI ? 1 : undefined ,
24- /* Reporter to use. See https://playwright.dev/docs/test-reporters */
25- reporter : "html" ,
26- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
27- use : {
28- /* Base URL to use in actions like `await page.goto('/')`. */
29- // baseURL: 'http://127.0.0.1:3000',
30-
31- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
32- trace : "retain-on-failure" ,
33- // Increase the timeout for navigations to give dx time to build the project
34- navigationTimeout : 50 * 60 * 1000 ,
35- } ,
36-
37- timeout : 50 * 60 * 1000 ,
38-
39- /* Configure projects for major browsers */
40- projects : [
11+ let webServer = [ ] ;
12+ let grep = undefined ;
13+ let grepInvert = undefined ;
14+ if ( process . platform === "win32" ) {
15+ webServer = [
4116 {
42- name : "chromium" ,
43- use : { ...devices [ "Desktop Chrome" ] } ,
17+ cwd : path . join ( process . cwd ( ) , "windows-headless" ) ,
18+ command :
19+ "cargo run --package dioxus-cli --release -- run --force-sequential" ,
20+ port : 8787 ,
21+ timeout : 50 * 60 * 1000 ,
22+ reuseExistingServer : ! process . env . CI ,
23+ stdout : "pipe" ,
4424 } ,
45- ] ,
46-
47- /* Run your local dev server before starting the tests */
48- webServer : [
25+ ] ;
26+ grep = / w i n d o w s / ;
27+ } else {
28+ webServer = [
4929 {
5030 command :
5131 "cargo run --package dioxus-playwright-liveview-test --bin dioxus-playwright-liveview-test" ,
@@ -224,5 +204,49 @@ module.exports = defineConfig({
224204 reuseExistingServer : ! process . env . CI ,
225205 stdout : "pipe" ,
226206 } ,
207+ ] ;
208+
209+ grepInvert = / w i n d o w s / ;
210+ }
211+
212+ /**
213+ * @see https://playwright.dev/docs/test-configuration
214+ */
215+ module . exports = defineConfig ( {
216+ testDir : "." ,
217+ /* Run tests in files in parallel */
218+ fullyParallel : true ,
219+ /* Fail the build on CI if you accidentally left test.only in the source code. */
220+ forbidOnly : ! ! process . env . CI ,
221+ /* Retry on CI only */
222+ retries : process . env . CI ? 2 : 0 ,
223+ /* Opt out of parallel tests on CI. */
224+ workers : process . env . CI ? 1 : undefined ,
225+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
226+ reporter : "html" ,
227+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
228+ use : {
229+ /* Base URL to use in actions like `await page.goto('/')`. */
230+ // baseURL: 'http://127.0.0.1:3000',
231+
232+ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
233+ trace : "retain-on-failure" ,
234+ // Increase the timeout for navigations to give dx time to build the project
235+ navigationTimeout : 50 * 60 * 1000 ,
236+ } ,
237+
238+ timeout : 50 * 60 * 1000 ,
239+
240+ /* Configure projects for major browsers */
241+ projects : [
242+ {
243+ name : "chromium" ,
244+ grep,
245+ grepInvert,
246+ use : { ...devices [ "Desktop Chrome" ] } ,
247+ } ,
227248 ] ,
249+
250+ /* Run your local dev server before starting the tests */
251+ webServer,
228252} ) ;
0 commit comments