File tree 6 files changed +97
-0
lines changed 6 files changed +97
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset' ;
2
+ import { defineConfig } from 'cypress' ;
3
+
4
+ export default defineConfig ( {
5
+ e2e : nxE2EPreset ( __filename , { cypressDir : 'cypress' } ) ,
6
+ } ) ;
Original file line number Diff line number Diff line change
1
+ describe ( 'RxAngular ISR' , ( ) => {
2
+ it ( 'should render home page with static data' , ( ) => {
3
+ cy . visit ( '/' ) ;
4
+
5
+ cy . get ( 'h1' ) . should ( 'contain' , 'Static' ) ;
6
+ cy . get ( 'p' ) . should ( 'contain' , 'Static' ) ;
7
+ } ) ;
8
+
9
+ it ( 'should render page 1 with dynamic data' , ( ) => {
10
+ cy . visit ( '/' ) ;
11
+
12
+ cy . intercept ( 'https://jsonplaceholder.typicode.com/posts/1' , {
13
+ body : {
14
+ title : 'Dynamic Title' ,
15
+ body : 'Dynamic Paragraph' ,
16
+ } ,
17
+ } ) ;
18
+
19
+ cy . get ( 'a' ) . contains ( 'Page 1' ) . click ( ) ;
20
+
21
+ cy . get ( 'h2' ) . contains ( 'Dynamic Title' ) ;
22
+ cy . get ( 'p' ) . contains ( 'Dynamic Paragraph' ) ;
23
+ } ) ;
24
+ } ) ;
Original file line number Diff line number Diff line change
1
+ /// <reference types="cypress" />
2
+
3
+ // ***********************************************
4
+ // This example commands.ts shows you how to
5
+ // create various custom commands and overwrite
6
+ // existing commands.
7
+ //
8
+ // For more comprehensive examples of custom
9
+ // commands please read more here:
10
+ // https://on.cypress.io/custom-commands
11
+ // ***********************************************
12
+
13
+ // eslint-disable-next-line @typescript-eslint/no-namespace, @typescript-eslint/no-unused-vars
14
+ declare namespace Cypress {
15
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-interface
16
+ interface Chainable < Subject > { }
17
+ }
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.ts using ES2015 syntax:
17
+ import './commands' ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ../tsconfig.json" ,
3
+ "compilerOptions" : {
4
+ "allowJs" : true ,
5
+ "outDir" : " ../../dist/out-tsc" ,
6
+ "module" : " commonjs" ,
7
+ "types" : [" cypress" , " node" ],
8
+ "sourceMap" : false
9
+ },
10
+ "include" : [
11
+ " **/*.ts" ,
12
+ " **/*.js" ,
13
+ " ../cypress.config.ts" ,
14
+ " ../**/*.cy.ts" ,
15
+ " ../**/*.cy.tsx" ,
16
+ " ../**/*.cy.js" ,
17
+ " ../**/*.cy.jsx" ,
18
+ " ../**/*.d.ts"
19
+ ]
20
+ }
Original file line number Diff line number Diff line change 73
73
"options" : {
74
74
"lintFilePatterns" : [" apps/ssr-isr/**/*.ts" , " apps/ssr-isr/**/*.html" ]
75
75
}
76
+ },
77
+ "e2e" : {
78
+ "executor" : " @nx/cypress:cypress" ,
79
+ "options" : {
80
+ "cypressConfig" : " apps/ssr-isr/cypress.config.ts" ,
81
+ "testingType" : " e2e" ,
82
+ "devServerTarget" : " ssr-isr:serve"
83
+ },
84
+ "configurations" : {
85
+ "production" : {
86
+ "devServerTarget" : " ssr-isr:serve:production"
87
+ }
88
+ }
76
89
}
77
90
}
78
91
}
You can’t perform that action at this time.
0 commit comments