File tree 8 files changed +119
-0
lines changed
8 files changed +119
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This to verify lib version bump doesn't break anything
2
+ name : E2E Tests
3
+
4
+ on :
5
+ push :
6
+ branches :
7
+ - master
8
+ - main
9
+ pull_request :
10
+ branches :
11
+ - ' **'
12
+
13
+ jobs :
14
+ publish-npm :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - uses : actions/checkout@v3
18
+ - uses : actions/setup-node@v3
19
+ with :
20
+ node-version : 16
21
+ registry-url : https://registry.npmjs.org/
22
+ - run : git config --global user.name "GitHub CD bot"
23
+ -
run :
git config --global user.email "[email protected] "
24
+ - name : Install deps
25
+ run : npm i -g wait-for-localhost-cli && npm i
26
+ - name : Start app and run tests
27
+ run : npm run serve & wait-for-localhost 8080; cd test/e2e; npm i && npx playwright install chromium && npm run test
28
+ env :
29
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -24,3 +24,8 @@ yarn-error.log*
24
24
/dist_electron
25
25
26
26
package-lock.json
27
+
28
+
29
+ test /e2e /node_modules
30
+ test /e2e /yarn.lock
31
+ test /e2e /output
Original file line number Diff line number Diff line change
1
+ export const config : CodeceptJS . MainConfig = {
2
+ tests : './*_test.ts' ,
3
+ output : './output' ,
4
+ helpers : {
5
+ Playwright : {
6
+ browser : 'chromium' ,
7
+ url : 'http://localhost:8080' ,
8
+ show : false ,
9
+ timeout : 10000 ,
10
+ waitForNavigation : 'load' ,
11
+ waitForTimeout : 10000
12
+ }
13
+ } ,
14
+ include : {
15
+ I : './steps_file'
16
+ } ,
17
+ name : 'e2e'
18
+ }
Original file line number Diff line number Diff line change
1
+ const { I } = inject ( ) ;
2
+
3
+ Feature ( 'homepage' ) ;
4
+
5
+
6
+ Scenario ( 'Home page is loaded' , ( ) => {
7
+ I . amOnPage ( '' ) ;
8
+ I . waitForText ( 'Write a Test' ) ;
9
+ } ) ;
10
+
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " e2e" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " " ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "test" : " npx codeceptjs run --verbose"
8
+ },
9
+ "author" : " " ,
10
+ "license" : " ISC" ,
11
+ "dependencies" : {
12
+ "codeceptjs" : " ^3.5.14" ,
13
+ "playwright" : " ^1.41.2"
14
+ },
15
+ "devDependencies" : {
16
+ "@types/node" : " 20.11.20" ,
17
+ "ts-node" : " 10.9.2" ,
18
+ "typescript" : " 5.3.3"
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ /// <reference types='codeceptjs' />
2
+ type steps_file = typeof import ( './steps_file' ) ;
3
+
4
+ declare namespace CodeceptJS {
5
+ interface SupportObject { I : I , current : any }
6
+ interface Methods extends Playwright { }
7
+ interface I extends ReturnType < steps_file > { }
8
+ namespace Translation {
9
+ interface Actions { }
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ // in this file you can append custom step methods to 'I' object
2
+
3
+ export = function ( ) {
4
+ return actor ( {
5
+
6
+ // Define custom steps here, use 'this' to access default methods of I.
7
+ // It is recommended to place a general 'login' function here.
8
+
9
+ } ) ;
10
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "ts-node" : {
3
+ "files" : true
4
+ },
5
+ "compilerOptions" : {
6
+ "target" : " es2018" ,
7
+ "lib" : [" es2018" , " DOM" ],
8
+ "esModuleInterop" : true ,
9
+ "module" : " commonjs" ,
10
+ "strictNullChecks" : false ,
11
+ "types" : [" codeceptjs" , " node" ],
12
+ "declaration" : true ,
13
+ "skipLibCheck" : true
14
+ },
15
+ "exclude" : [" node_modules" ]
16
+ }
You can’t perform that action at this time.
0 commit comments