Skip to content

Commit

Permalink
fix: cypress error scenario on downloading rules definitions file (#1617
Browse files Browse the repository at this point in the history
)
  • Loading branch information
davidgamez committed Nov 27, 2023
1 parent 5c9e4d1 commit fe69b97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions web/client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ vite.config.js.timestamp-*
vite.config.ts.timestamp-*
/notice_schema.json
rules.json
cypress/screenshots/
cypress/videos/
13 changes: 5 additions & 8 deletions web/client/cypress/e2e/error_messages.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

context('GTFS Validator - Confirm error messaging', () => {
beforeEach(() => {
cy.visit('https://gtfs-validator.mobilitydata.org/')
cy.visit('https://gtfs-validator-staging.mobilitydata.org/')
});

it('Confirm error "Error authorizing upload"', () => {
Expand Down Expand Up @@ -35,7 +35,7 @@ context('GTFS Validator - Confirm error messaging', () => {
// Setup intercept aliases
cy.intercept(
'PUT',
'https://storage.googleapis.com/gtfs-validator-user-uploads/*/gtfs-job.zip?*',
'https://storage.googleapis.com/stg-gtfs-validator-user-uploads/*/gtfs-job.zip?*',
{ forceNetworkError: true }
)
.as('putFile');
Expand Down Expand Up @@ -78,7 +78,7 @@ context('GTFS Validator - Confirm error messaging', () => {

cy.intercept(
'HEAD',
'https://gtfs-validator-results.mobilitydata.org/*/report.html',
'https://staging-gtfs-validator-results.mobilitydata.org/*/report.html',
{ forceNetworkError: true }
)
.as('awaitJob');
Expand All @@ -101,7 +101,7 @@ context('GTFS Validator - Confirm error messaging', () => {
it('Confirm error "HTTP Error: 404"', () => {
// Setup intercept aliases
cy.intercept(
'https://gtfs-validator.mobilitydata.org/RULES.md',
'https://gtfs-validator-staging.mobilitydata.org/rules.json',
(req) => {
req.reply({
statusCode: 404
Expand All @@ -121,10 +121,7 @@ context('GTFS Validator - Confirm error messaging', () => {
.should('be.visible')
.within((div) => {
cy.get('h1').should('contain.text', 'HTTP Error: 404');
cy.get('p').should('contain.text', 'There was a problem loading the rules file. You can try accessing it directly at');
cy.get('a')
.should('contain.text', 'https://github.com/MobilityData/gtfs-validator/blob/master/RULES.md')
.and('have.attr', 'href', 'https://github.com/MobilityData/gtfs-validator/blob/master/RULES.md');
cy.get('p').should('contain.text', 'There was a problem loading the rules file.');
})
});
});

0 comments on commit fe69b97

Please sign in to comment.