forked from ustaxcourt/ef-cms
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '10007-story' of https://github.com/flexion/ef-cms into …
…10007-story-dod
- Loading branch information
Showing
42 changed files
with
2,769 additions
and
2,995 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ version: 2.1 | |
orbs: | ||
git-shallow-clone: guitarrapc/[email protected] | ||
|
||
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:3.1.2 | ||
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:3.1.3 | ||
|
||
parameters: | ||
run_build_and_deploy: | ||
|
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,81 @@ | ||
import { cypressEnv } from '../../helpers/env/cypressEnvironment'; | ||
|
||
describe('Given a user with a DAWSON account', () => { | ||
beforeEach(() => { | ||
Cypress.session.clearCurrentSessionData(); | ||
}); | ||
|
||
describe('When they login in with the correct email and password', () => { | ||
it('Then they should be taken to their dashboard', () => { | ||
cy.visit('/login'); | ||
// Login Button is Disabled till Enter Both Email and Password | ||
cy.get('[data-testid="login-button"]').should('be.disabled'); | ||
cy.get('[data-testid="email-input"]').type( | ||
'[email protected]', | ||
); | ||
cy.get('[data-testid="password-input"]').type( | ||
cypressEnv.defaultAccountPass, | ||
{ | ||
log: false, | ||
}, | ||
); | ||
cy.get('[data-testid="login-button"]').click(); | ||
cy.get('[data-testid="account-menu-button"]'); | ||
cy.get('[data-testid="error-alert"]').should('not.exist'); | ||
|
||
// after reloading they are still logged in | ||
cy.reload(); | ||
cy.get('[data-testid="account-menu-button"]'); | ||
cy.get('[data-testid="error-alert"]').should('not.exist'); | ||
cy.url().should('contain', '/messages'); | ||
|
||
// manually access url (still logged in) | ||
cy.visit('/trial-sessions'); | ||
cy.get('[data-testid="header-text"]').should('contain', 'Trial Sessions'); | ||
cy.url().should('contain', '/trial-sessions'); | ||
}); | ||
}); | ||
|
||
describe('When they login with a correct email and an misspelled password', () => { | ||
it('Then they should be alerted that their username or password is incorrect', () => { | ||
cy.visit('/login'); | ||
cy.get('[data-testid="email-input"]').type( | ||
'[email protected]', | ||
); | ||
cy.get('[data-testid="password-input"]').type('testing1234$', { | ||
log: false, | ||
}); | ||
cy.get('[data-testid="login-button"]').click(); | ||
|
||
cy.get('[data-testid="error-alert"]').should( | ||
'contain', | ||
'The email address or password you entered is invalid', | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Given a user without a DAWSON account', () => { | ||
beforeEach(() => { | ||
Cypress.session.clearCurrentSessionData(); | ||
}); | ||
|
||
describe('When they login', () => { | ||
it('Then they should be alerted that their username or password is incorrect', () => { | ||
cy.visit('/login'); | ||
cy.get('[data-testid="email-input"]').type('[email protected]'); | ||
cy.get('[data-testid="password-input"]').type( | ||
cypressEnv.defaultAccountPass, | ||
{ | ||
log: false, | ||
}, | ||
); | ||
cy.get('[data-testid="login-button"]').click(); | ||
|
||
cy.get('[data-testid="error-alert"]').should( | ||
'contain', | ||
'The email address or password you entered is invalid', | ||
); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.