File tree 9 files changed +788
-8
lines changed
9 files changed +788
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : Run Cypress Tests
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - " main"
7
+ pull_request :
8
+ workflow_dispatch :
9
+
10
+ jobs :
11
+ tests :
12
+ runs-on : ubuntu-22.04
13
+
14
+ strategy :
15
+ fail-fast : false
16
+ matrix :
17
+ project :
18
+ [
19
+ " angular" ,
20
+ # "angular-standalone",
21
+ # "react-next14-ts",
22
+ # "react-next15-ts",
23
+ # "react-vite-ts",
24
+ # "react-webpack5-js",
25
+ # "svelte-vite-ts",
26
+ # "svelte-webpack-ts",
27
+ # "vue3-vite-ts",
28
+ # "vue3-webpack-ts",
29
+ ]
30
+
31
+ name : Cypress Tests
32
+ steps :
33
+ - name : Checkout
34
+ uses : actions/checkout@v4
35
+ - name : Setup Node.js
36
+ uses : actions/setup-node@v4
37
+ with :
38
+ node-version : 22
39
+ # - name: Cypress Component Tests
40
+ # uses: cypress-io/github-action@v6
41
+ # with:
42
+ # component: true
43
+ # working-directory: "${{ matrix.project }}"
44
+ # smoke tests the sample app and makes sure everything works as expected
45
+ - name : Cypress E2E Tests
46
+ uses : cypress-io/github-action@v6
47
+ with :
48
+ start : npm start
49
+ wait-on : ' http://localhost:4200'
50
+ working-directory : " ${{ matrix.project }}"
51
+ browser : chrome
52
+
Original file line number Diff line number Diff line change @@ -8,4 +8,10 @@ export default defineConfig({
8
8
} ,
9
9
specPattern : "**/*.cy.ts" ,
10
10
} ,
11
+
12
+ e2e : {
13
+ setupNodeEvents ( on , config ) {
14
+ // implement node event listeners here
15
+ } ,
16
+ } ,
11
17
} ) ;
Original file line number Diff line number Diff line change
1
+ describe ( 'Authentication' , ( ) => {
2
+ it ( 'Logs in' , ( ) => {
3
+ cy . visit ( 'http://localhost:4200' )
4
+ cy . get ( '[name="username"]' ) . type ( 'testuser' )
5
+ cy . get ( '[name="password"]' ) . type ( 'testpassword' )
6
+ cy . get ( '[type="submit"]' ) . click ( )
7
+ cy . get ( 'h1' ) . should ( 'have.text' , 'Welcome testuser' )
8
+ } )
9
+ } )
Original file line number Diff line number Diff line change
1
+ // ***********************************************************
2
+ // This example support/e2e.ts is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+
16
+ // Import commands.js using ES2015 syntax:
17
+ import './commands'
You can’t perform that action at this time.
0 commit comments