-
-
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): add SPA tests for login and refactor tests to typescript
- Loading branch information
Showing
4 changed files
with
138 additions
and
93 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
115 changes: 62 additions & 53 deletions
115
test/e2e/cypress/integration/profiles/email/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
31 changes: 0 additions & 31 deletions
31
test/e2e/cypress/integration/profiles/email/login/ui.spec.js
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
test/e2e/cypress/integration/profiles/email/login/ui.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,41 @@ | ||
import {routes as express} from "../../../../helpers/express"; | ||
import {routes as react} from "../../../../helpers/react"; | ||
|
||
context('UI tests using the email profile', () => { | ||
[{ | ||
route: express.login, | ||
app: 'express', profile: 'email' | ||
}, { | ||
route: react.login, | ||
app: 'react', profile: 'spa' | ||
}].forEach(({route, profile, app}) => { | ||
describe(`for app ${app}`, () => { | ||
before(() => { | ||
cy.useConfigProfile(profile) | ||
}) | ||
|
||
beforeEach(() => { | ||
cy.visit(route) | ||
}) | ||
|
||
it('should use the json schema titles', () => { | ||
cy.get('input[name="password_identifier"]') | ||
.parent() | ||
.should('contain.text', 'ID') | ||
cy.get('input[name="password"]') | ||
.parent() | ||
.should('contain.text', 'Password') | ||
cy.get('button[value="password"]').should('contain.text', 'Sign in') | ||
}) | ||
|
||
it('clicks the log in link', () => { | ||
cy.get('a[href*="registration"]').click() | ||
cy.location('pathname').should('include', 'registration') | ||
|
||
if (app === 'express') { | ||
cy.location('search').should('not.be.empty') | ||
} | ||
}) | ||
}) | ||
}) | ||
}) |