mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Added some cypress tests
This commit is contained in:
15
cypress-tests/cypress/support/commands.js
Normal file
15
cypress-tests/cypress/support/commands.js
Normal file
@@ -0,0 +1,15 @@
|
||||
Cypress.Commands.add('login', () => {
|
||||
cy.visit('/');
|
||||
|
||||
cy.contains('Log In').click();
|
||||
cy.url().should('include', '/users/sign_in');
|
||||
|
||||
// Fill in login form and submit
|
||||
cy.get('[id=user_email]').type(Cypress.env('CYPRESS_USERNAME'));
|
||||
cy.get('[id=user_password]').type(Cypress.env('CYPRESS_PASSWORD'));
|
||||
cy.get('input[type=submit]').click();
|
||||
|
||||
// Verify successful login
|
||||
cy.contains('Signed in successfully');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user