mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-05 22:19:46 -06:00
chore: remove httpstat.us dependency, add utility route for cy-in-cy (#31961)
This commit is contained in:
@@ -104,11 +104,15 @@ export const createCommonRoutes = ({
|
||||
})
|
||||
|
||||
// If we are in cypress in cypress we need to pass along the studio routes
|
||||
// to the child project.
|
||||
// to the child project. We also add a utility route for testing HTTP status code UI
|
||||
if (process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT) {
|
||||
router.get('/__cypress-studio/*', async (req, res) => {
|
||||
await networkProxy.handleHttpRequest(req, res)
|
||||
})
|
||||
|
||||
router.get('/status-code-test/:num', (req, res) => {
|
||||
res.sendStatus(Number(req.params.num))
|
||||
})
|
||||
} else {
|
||||
// express matches routes in order. since this callback executes after the
|
||||
// router has already been defined, we need to create a new router to use
|
||||
|
||||
@@ -6,6 +6,6 @@ describe('Errors', () => {
|
||||
})
|
||||
|
||||
it('long error', () => {
|
||||
cy.request('http://httpstat.us/500')
|
||||
cy.request('/status-code-test/500')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
describe('Status Codes', () => {
|
||||
it('Request Statuses', () => {
|
||||
cy.request('https://httpstat.us/200')
|
||||
cy.request('https://httpstat.us/304')
|
||||
cy.request('/status-code-test/200')
|
||||
cy.request('/status-code-test/304')
|
||||
|
||||
cy.request({
|
||||
url: 'https://httpstat.us/400',
|
||||
url: '/status-code-test/400',
|
||||
failOnStatusCode: false,
|
||||
})
|
||||
|
||||
cy.request({
|
||||
url: 'https://httpstat.us/502',
|
||||
url: '/status-code-test/502',
|
||||
failOnStatusCode: false,
|
||||
})
|
||||
|
||||
cy.request({
|
||||
url: 'https://httpstat.us/103',
|
||||
url: '/status-code-test/103',
|
||||
timeout: 2000,
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user