-
-
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): complete SPA tests for all mfa flows
- Loading branch information
Showing
21 changed files
with
718 additions
and
597 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
39 changes: 0 additions & 39 deletions
39
test/e2e/cypress/integration/profiles/mfa/settings.spec.js
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
test/e2e/cypress/integration/profiles/mfa/settings.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,57 @@ | ||
import {gen, website} from '../../../helpers' | ||
import {routes as express} from "../../../helpers/express"; | ||
import {routes as react} from "../../../helpers/react"; | ||
|
||
context('2FA UI settings tests', () => { | ||
[ | ||
{ | ||
settings: react.settings, | ||
base: react.base, | ||
app: 'react', profile: 'spa' | ||
}, | ||
{ | ||
settings: express.settings, | ||
base: express.base, | ||
app: 'express', profile: 'mfa' | ||
} | ||
].forEach(({settings, profile, base, app}) => { | ||
describe(`for app ${app}`, () => { | ||
before(() => { | ||
cy.useConfigProfile(profile) | ||
}) | ||
|
||
const email = gen.email() | ||
const password = gen.password() | ||
|
||
before(() => { | ||
cy.registerApi({email, password, fields: {'traits.website': website}}) | ||
}) | ||
|
||
beforeEach(() => { | ||
cy.clearCookies() | ||
cy.login({email, password, cookieUrl: base}) | ||
cy.visit(settings) | ||
}) | ||
|
||
it('shows all settings forms', () => { | ||
cy.get('h3').should('contain.text', 'Profile Settings') | ||
cy.get('h3').should('contain.text', 'Change Password') | ||
cy.get('h3').should('contain.text', 'Manage 2FA Backup Recovery Codes') | ||
cy.get('h3').should('contain.text', 'Manage 2FA TOTP Authenticator App') | ||
cy.get('h3').should('contain.text', 'Manage Hardware Tokens') | ||
cy.get('input[name="traits.email"]').should('contain.value', email) | ||
cy.get('input[name="traits.website"]').should('contain.value', website) | ||
|
||
cy.get('[data-testid="node/text/totp_secret_key/label"]').should( | ||
'contain.text', | ||
'This is your authenticator app secret' | ||
) | ||
cy.get('button').should( | ||
'contain.text', | ||
'Generate new backup recovery codes' | ||
) | ||
cy.get('button').should('contain.text', 'Add security key') | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.