2. Who am I ?
QA Trainer at Start IT
AQA Trainer at Start IT
TPM / Lead BA at EPAM
QA Lead at FastCTO
Cypress.io enthusiast
Ukraine addicted guy!
Life Lover
7. Custom Commands
Create custom functionalities
Overwrite existing functionalities
Reuse once described from test to
test
1. Go to './cypress/support'
2. Edit 'commands.js' file, or create new one
3. Don't forget to import newly created to './cypress/support/index.js'
cy.get('[data-test="username-field"]').type("Admin")
cy.get('[data-test="password-field"]').type("admin12345")
cy.get('[data-test="rememberme-checkbox"]').click()
cy.get('[data-test="login-button"]').click()
Cypress.Commands.add("getBySel", (selector) => {
return cy.get(`[data-test=${selector}]`)
})
cy.getBySel("username-field").type("Admin")
cy.getBySel("password-field").type("admin12345")
cy.getBySel("rememberme-checkbox").click()
cy.getBySel("login-button").click()