Skip to content

Instantly share code, notes, and snippets.

@RomainGoncalves
Last active May 28, 2018 20:54
Show Gist options
  • Save RomainGoncalves/9df396948ba335599eb002eebf70e4f1 to your computer and use it in GitHub Desktop.
Save RomainGoncalves/9df396948ba335599eb002eebf70e4f1 to your computer and use it in GitHub Desktop.
Cypress test using cy.request
describe('Fetch Movies', () => {
it('should contain all the expected attributes', () => {
cy.request('GET', 'https://swapi.co/api/films/1/').its('body.title').should('contain', 'A New Hope');
cy.request('GET', 'https://swapi.co/api/films/1/').its('body.director').should('contain', 'George Lucas');
// ... check more attributes
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment