tests(fix): update start-server-and-test, update e2e tests, change build test command at ci

This commit is contained in:
yubathom
2020-02-01 18:36:51 -03:00
parent 7cf5345c5a
commit 85c5f16e93
8 changed files with 152 additions and 102 deletions

View File

@@ -7,10 +7,23 @@
*/
Cypress.Commands.add('seedAndVisit', (seedData, path = '/', method = 'GET') => {
cy.server()
.route(method, 'https://api.thecatapi.com/', `fixture:${seedData}`).as(
'load'
)
.route(method, 'https://api.thecatapi.com/', `fixture:${seedData}`).as('load')
cy.visit(path)
.get('#send').click()
.wait('@load')
.wait('@load')
})
/**
* Creates cy.enableProxy() function
* This function will enable the proxy and navigate back to a given path
* @param { String } goBackPath The page go back
*/
Cypress.Commands.add('enableProxy', (goBackPath) => {
cy.visit('/settings')
.get('#proxy')
.find('.toggle')
.click( { force: true } )
.should('have.class', 'on')
.visit(goBackPath)
})