File tree Expand file tree Collapse file tree 9 files changed +794
-8
lines changed
Expand file tree Collapse file tree 9 files changed +794
-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 : Component 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+ name : E2E Tests
45+ steps :
46+ - name : Checkout
47+ uses : actions/checkout@v4
48+ - name : Setup Node.js
49+ uses : actions/setup-node@v4
50+ with :
51+ node-version : 22
52+ # smoke tests the sample app and makes sure everything works as expected
53+ - name : Cypress E2E Tests
54+ uses : cypress-io/github-action@v6
55+ with :
56+ start : npm start
57+ working-directory : " ${{ matrix.project }}"
58+
Original file line number Diff line number Diff line change @@ -8,4 +8,10 @@ export default defineConfig({
88 } ,
99 specPattern : "**/*.cy.ts" ,
1010 } ,
11+
12+ e2e : {
13+ setupNodeEvents ( on , config ) {
14+ // implement node event listeners here
15+ } ,
16+ } ,
1117} ) ;
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