forked from bbc/simorgh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'latest' into 2849-add-photogallery-offscreen-text
- Loading branch information
Showing
57 changed files
with
1,405 additions
and
1,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
describe('Data endpoints 200 and return JSON', () => { | ||
it('should pass for front pages', () => { | ||
cy.testResponseCodeAndType( | ||
'https://www.bbc.com/igbo.json', | ||
200, | ||
'application/json', | ||
); | ||
cy.testResponseCodeAndType( | ||
'https://www.bbc.com/pidgin.json', | ||
200, | ||
'application/json', | ||
); | ||
|
||
cy.testResponseCodeAndType( | ||
'https://www.bbc.com/yoruba.json', | ||
200, | ||
'application/json', | ||
); | ||
}); | ||
it('should pass for articles', () => { | ||
cy.testResponseCodeAndType( | ||
'https://www.bbc.com/news/articles/c5ll353v7y9o.json', | ||
200, | ||
'application/json', | ||
); | ||
cy.testResponseCodeAndType( | ||
'https://www.bbc.com/persian/articles/c7eel0lmr4do.json', | ||
200, | ||
'application/json', | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// These are deliberately duplicated from the other cypress folder to avoid interrelationships blocking changes. | ||
Cypress.Commands.add('testResponseCodeAndType', (path, responseCode, type) => { | ||
cy.request({ url: path, failOnStatusCode: false }).then( | ||
({ status, headers }) => { | ||
expect(status).to.eq(responseCode); | ||
expect(headers['content-type']).to.include(type); | ||
// Always ensure we're not seeing the Mozart fallback | ||
expect(headers).not.to.have.property('x-mfa'); | ||
}, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './commands'; | ||
|
||
Cypress.Screenshot.defaults({ | ||
screenshotOnRunFailure: false, | ||
}); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.