-
-
Notifications
You must be signed in to change notification settings - Fork 931
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): implement required verification tests for SPA
- Loading branch information
Showing
4 changed files
with
80 additions
and
57 deletions.
There are no files selected for viewing
29 changes: 0 additions & 29 deletions
29
test/e2e/cypress/integration/profiles/verification/login/errors.spec.js
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
test/e2e/cypress/integration/profiles/verification/login/errors.spec.ts
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,40 @@ | ||
import { gen } from '../../../../helpers' | ||
import {routes as react} from "../../../../helpers/react"; | ||
import {routes as express} from "../../../../helpers/express"; | ||
|
||
context('Account Verification Login Errors', () => { | ||
[ | ||
{ | ||
login: react.login, | ||
app: 'react', profile: 'verification' | ||
}, | ||
{ | ||
login: express.login, | ||
app: 'express', profile: 'verification' | ||
} | ||
].forEach(({profile,login, app}) => { | ||
describe(`for app ${app}`, () => { | ||
before(() => { | ||
cy.deleteMail() | ||
cy.useConfigProfile(profile) | ||
cy.enableLoginForVerifiedAddressOnly() | ||
}) | ||
|
||
it('is unable to login as long as the email is not verified', () => { | ||
cy.deleteMail() | ||
|
||
const identity = gen.identityWithWebsite() | ||
cy.registerApi(identity) | ||
cy.visit(login) | ||
|
||
cy.get('[name="password_identifier"]').type(identity.email) | ||
cy.get('[name="password"]').type(identity.password) | ||
cy.get('[value="password"]').click() | ||
|
||
cy.get('[data-testid="ui/message/4000010"]').contains('Account not active yet') | ||
|
||
cy.noSession() | ||
}) | ||
}) | ||
}) | ||
}) |
28 changes: 0 additions & 28 deletions
28
test/e2e/cypress/integration/profiles/verification/login/success.spec.js
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
test/e2e/cypress/integration/profiles/verification/login/success.spec.ts
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,40 @@ | ||
import { APP_URL, gen } from '../../../../helpers' | ||
import {routes as react} from "../../../../helpers/react"; | ||
import {routes as express} from "../../../../helpers/express"; | ||
|
||
context('Account Verification Login Success', () => { | ||
[ | ||
{ | ||
login: react.login, | ||
app: 'react', profile: 'verification' | ||
}, | ||
{ | ||
login: express.login, | ||
app: 'express', profile: 'verification' | ||
} | ||
].forEach(({profile,login, app}) => { | ||
describe(`for app ${app}`, () => { | ||
before(() => { | ||
cy.deleteMail() | ||
cy.useConfigProfile(profile) | ||
cy.enableLoginForVerifiedAddressOnly() | ||
}) | ||
|
||
it('is able to login after successful email verification', () => { | ||
cy.deleteMail() | ||
|
||
const identity = gen.identityWithWebsite() | ||
cy.registerApi(identity) | ||
cy.performEmailVerification({ expect: { email: identity.email } }) | ||
|
||
cy.visit(login) | ||
|
||
cy.get('input[name="password_identifier"]').type(identity.email) | ||
cy.get('input[name="password"]').type(identity.password) | ||
cy.get('button[value="password"]').click() | ||
|
||
cy.getSession() | ||
}) | ||
}) | ||
}) | ||
}) |