1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-19 19:43:46 +00:00

Added cypress tests for mat stats javascript.

This commit is contained in:
2025-05-05 19:57:03 -04:00
parent 68a7b214c9
commit 2856060b11
13 changed files with 605 additions and 46 deletions

View File

@@ -4,24 +4,27 @@ describe('Testing Log In', () => {
cy.contains('Log In').click()
// Should be on a new URL which
// includes '/commands/actions'
cy.url().should('include', '/users/sign_in')
// Should be on the login URL
cy.url().should('include', '/login')
// Get an input, type into it
cy.get('[id=user_email]').type(Cypress.env('CYPRESS_USERNAME'))
cy.get('input[type=email]').type(Cypress.env('CYPRESS_USERNAME'))
// Verify that the value has been updated
cy.get('[id=user_email]').should('have.value', Cypress.env('CYPRESS_USERNAME'))
cy.get('input[type=email]').should('have.value', Cypress.env('CYPRESS_USERNAME'))
// Get an input, type into it
cy.get('[id=user_password]').type(Cypress.env('CYPRESS_PASSWORD'))
cy.get('input[type=password]').type(Cypress.env('CYPRESS_PASSWORD'))
// Verify that the value has been updated
cy.get('[id=user_password]').should('have.value', Cypress.env('CYPRESS_PASSWORD'))
cy.get('input[type=password]').should('have.value', Cypress.env('CYPRESS_PASSWORD'))
cy.get('input[type=submit]').click()
cy.contains('Signed in successfully')
// Check for successful login message
cy.contains('Logged in successfully')
// Verify we can see user email in navbar after login
cy.get('.navbar').contains(Cypress.env('CYPRESS_USERNAME'))
})
})