tests(fix): update start-server-and-test, update e2e tests, change build test command at ci
This commit is contained in:
@@ -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)
|
||||
})
|
||||
Reference in New Issue
Block a user