File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { test as base } from '@playwright/test' ;
1+ // Use require instead of import to avoid TypeScript errors
2+ const { test : base , expect } = require ( '@playwright/test' ) ;
23
34// Define a fixture that sets up the test environment
45export const test = base . extend ( {
56 // Add any global setup here if needed
67} ) ;
78
8- export { expect } from '@playwright/test' ;
9-
9+ export { expect } ;
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "private" : true ,
55 "scripts" : {
6- "test" : " playwright test" ,
7- "test:ui" : " playwright test --ui" ,
8- "test:debug" : " playwright test --debug" ,
9- "report" : " playwright show-report"
10- },
11- "devDependencies" : {
12- "@playwright/test" : " 1.14.0"
6+ "install-playwright" : " npx playwright@1.40.0 install --with-deps" ,
7+ "test" : " npx playwright@1.40.0 test" ,
8+ "test:ui" : " npx playwright@1.40.0 test --ui" ,
9+ "test:debug" : " npx playwright@1.40.0 test --debug" ,
10+ "report" : " npx playwright@1.40.0 show-report"
1311 }
1412}
15-
Original file line number Diff line number Diff line change 11import { defineConfig , devices } from '@playwright/test' ;
22
3- export default defineConfig ( {
3+ // Use require instead of import to avoid TypeScript errors
4+ // when @playwright /test is not in node_modules
5+ const { defineConfig, devices } = require ( '@playwright/test' ) ;
6+
7+ module . exports = defineConfig ( {
48 testDir : './tests' ,
59 timeout : 60000 ,
610 fullyParallel : true ,
@@ -31,8 +35,7 @@ export default defineConfig({
3135 webServer : process . env . CI ? undefined : {
3236 command : 'cd ../.. && yarn dev' ,
3337 url : 'http://localhost:3000' ,
34- reuseExistingServer : true ,
38+ reuseExistingServer : ! process . env . CI ,
3539 timeout : 120000 ,
3640 } ,
3741} ) ;
38-
Original file line number Diff line number Diff line change 88 "outDir" : " dist" ,
99 "baseUrl" : " ." ,
1010 "strict" : true ,
11- "lib" : [" esnext" , " dom" ]
11+ "lib" : [" esnext" , " dom" ],
12+ "allowJs" : true ,
13+ "checkJs" : false
1214 },
13- "include" : [" **/*.ts" ]
15+ "include" : [" **/*.ts" , " **/*.js " ]
1416}
15-
You can’t perform that action at this time.
0 commit comments