File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
system-tests/project-fixtures/runner-specs/cypress/e2e/runner/ui-states Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -104,11 +104,15 @@ export const createCommonRoutes = ({
104
104
} )
105
105
106
106
// If we are in cypress in cypress we need to pass along the studio routes
107
- // to the child project.
107
+ // to the child project. We also add a utility route for testing HTTP status code UI
108
108
if ( process . env . CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT ) {
109
109
router . get ( '/__cypress-studio/*' , async ( req , res ) => {
110
110
await networkProxy . handleHttpRequest ( req , res )
111
111
} )
112
+
113
+ router . get ( '/status-code-test/:num' , ( req , res ) => {
114
+ res . sendStatus ( Number ( req . params . num ) )
115
+ } )
112
116
} else {
113
117
// express matches routes in order. since this callback executes after the
114
118
// router has already been defined, we need to create a new router to use
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ describe('Errors', () => {
6
6
} )
7
7
8
8
it ( 'long error' , ( ) => {
9
- cy . request ( 'http://httpstat.us /500' )
9
+ cy . request ( '/status-code-test /500' )
10
10
} )
11
11
} )
Original file line number Diff line number Diff line change 1
1
describe ( 'Status Codes' , ( ) => {
2
2
it ( 'Request Statuses' , ( ) => {
3
- cy . request ( 'https://httpstat.us /200' )
4
- cy . request ( 'https://httpstat.us /304' )
3
+ cy . request ( '/status-code-test /200' )
4
+ cy . request ( '/status-code-test /304' )
5
5
6
6
cy . request ( {
7
- url : 'https://httpstat.us /400' ,
7
+ url : '/status-code-test /400' ,
8
8
failOnStatusCode : false ,
9
9
} )
10
10
11
11
cy . request ( {
12
- url : 'https://httpstat.us /502' ,
12
+ url : '/status-code-test /502' ,
13
13
failOnStatusCode : false ,
14
14
} )
15
15
16
16
cy . request ( {
17
- url : 'https://httpstat.us /103' ,
17
+ url : '/status-code-test /103' ,
18
18
timeout : 2000 ,
19
19
} )
20
20
} )
You can’t perform that action at this time.
0 commit comments