-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/uts-dsep-auth-homepage-searchpage' into develop-1.1.0
- Loading branch information
Showing
23 changed files
with
901 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { testIds } from '../../../shared/dataTestIds' | ||
|
||
// boc testing level 2 | ||
|
||
describe('Check Auth flow', () => { | ||
context('Signin flow', () => { | ||
beforeEach(() => { | ||
cy.visit(testIds.url_base) | ||
}) | ||
|
||
it('should display the sign-in form with email and password fields', () => { | ||
cy.getByData(testIds.auth_inputEmail).should('exist').and('be.visible') | ||
cy.getByData(testIds.auth_inputPassword).should('exist').and('be.visible') | ||
}) | ||
|
||
it('should display the sign-in and sign-up buttons', () => { | ||
cy.getByData(testIds.auth_loginButton).should('exist').and('be.visible') | ||
cy.getByData(testIds.auth_registerButton).should('exist').and('be.visible') | ||
}) | ||
|
||
it('should disable the signin button when form is submitted with empty fields', () => { | ||
cy.getByData(testIds.auth_loginButton).should('be.disabled') | ||
}) | ||
|
||
it('should update email and password fields when typed into', () => { | ||
cy.getByData(testIds.auth_inputEmail).type(testIds.user_validEmail) | ||
cy.getByData(testIds.auth_inputEmail).should('have.value', testIds.user_validEmail) | ||
cy.getByData(testIds.auth_inputPassword).type(testIds.user_validPassword) | ||
cy.getByData(testIds.auth_inputPassword).should('have.value', testIds.user_validPassword) | ||
}) | ||
|
||
it('should enable the Sign In button when both fields are filled', () => { | ||
cy.getByData(testIds.auth_inputEmail).type(testIds.user_validEmail) | ||
cy.getByData(testIds.auth_inputPassword).type(testIds.user_validPassword) | ||
cy.getByData(testIds.auth_loginButton).should('not.be.disabled') | ||
}) | ||
|
||
it('should show error toast on unsuccessful login', () => { | ||
cy.getByData(testIds.auth_inputEmail).type(testIds.user_validEmail) | ||
cy.getByData(testIds.auth_inputPassword).type(testIds.user_invalidPassword) | ||
cy.getByData(testIds.auth_loginButton).click() | ||
cy.getByData(testIds.feedback).should('contain.text', 'Invalid identifier or password') | ||
}) | ||
|
||
it('should navigate to sign-up page when Sign Up button is clicked', () => { | ||
cy.contains('button', 'Sign Up').click() | ||
cy.url().should('include', testIds.url_signup) | ||
}) | ||
|
||
it('should redirect to homePage and have token in cookie on successful login', () => { | ||
cy.login(testIds.url_base, testIds.user_validEmail, testIds.user_validPassword) | ||
cy.url().should('include', testIds.url_home) | ||
cy.getCookie('authToken').should('exist') | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.