Skip to content

Instantly share code, notes, and snippets.

View RomainGoncalves's full-sized avatar
🍜
Always make noise!

Romain Gonçalvés RomainGoncalves

🍜
Always make noise!
  • Zurich
View GitHub Profile
describe('Fetch Movies', () => {
it('should contain all the expected attributes', () => {
cy.fetchFilm(1).as('firstMovie');
const toTest = [
{ target: 'body.title', value: 'A New Hope', should: 'contain' },
{ target: 'body.director', value: 'George Lucas', should: 'contain' },
// Check for at least 1 producer
{ target: 'body.producer', value: 'Rick McCallum', should: 'contain' },
// We can also check for any assertion that Mocha/Chai provides
// cypress/support/commands.js
Cypress.Commands.add('fetchFilm', movieIndex => {
cy.request('GET', `https://swapi.co/api/films/${movieIndex}/`);
});
// integration/api/fetchMovies.js
describe('API Requests', () => {
it('should get successful response', () => {
cy.fetchFilm(1).as('firstMovie');
@RomainGoncalves
RomainGoncalves / episode4_spec.js
Created May 28, 2018 19:55
Doing multiple API request with Cypress
describe('API Requests', () => {
it('should get successful response', () => {
cy.request('GET', 'https://swapi.co/api/films/1/')
.its('body.title').should('contain', 'A New Hope');
});
it('should get successful response', () => {
cy.request('GET', 'https://swapi.co/api/films/1/')
.then(response => {
response.body.planets.forEach(planet =>
@RomainGoncalves
RomainGoncalves / fetchMovies_spec.js
Last active May 28, 2018 20:54
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
});
});
{
"legal_entity": {
"dob": {
"day": "02",
"month": "02",
"year": "1984"
},
"type": "company"
},
"account_token": "ct_1BxgU6KkwESpMrRrbwOgK178"

Kind of continue from the other gist how to install LAMP on an Amazon AMI

##Install git

sudo yum install git-core

##Create ssh directory since it doesn't exists by default on the Amazon AMI