-
-
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): prototype typescript implementation
- Loading branch information
Showing
30 changed files
with
301 additions
and
250 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,75 @@ | ||
export const email = () => Math.random().toString(36) + '@ory.sh' | ||
|
||
export const password = () => Math.random().toString(36) | ||
|
||
export const assertVerifiableAddress = ({isVerified, email}) => ({identity}) => { | ||
expect(identity).to.have.property('verifiable_addresses') | ||
expect(identity.verifiable_addresses).to.have.length(1) | ||
|
||
const address = identity.verifiable_addresses[0] | ||
expect(address.id).to.not.be.empty | ||
expect(address.verified).to.equal(isVerified) | ||
expect(address.value).to.equal(email) | ||
|
||
if (isVerified) { | ||
expect(address.verified_at).to.not.be.null | ||
} else { | ||
expect(address).to.not.have.property('verified_at') | ||
} | ||
} | ||
|
||
export const assertRecoveryAddress = ({email}) => ({identity}) => { | ||
expect(identity).to.have.property('recovery_addresses') | ||
expect(identity.recovery_addresses).to.have.length(1) | ||
|
||
const address = identity.recovery_addresses[0] | ||
expect(address.id).to.not.be.empty | ||
expect(address.value).to.equal(email) | ||
} | ||
|
||
export const parseHtml = (html) => new DOMParser().parseFromString(html, 'text/html') | ||
|
||
export const APP_URL = (Cypress.env('app_url') || 'http://localhost:4455').replace( | ||
/\/$/, | ||
'' | ||
) | ||
|
||
export const MOBILE_URL = (Cypress.env('mobile_url') || 'http://localhost:4457').replace( | ||
/\/$/, | ||
'' | ||
) | ||
export const SPA_URL = (Cypress.env('react_url') || 'http://localhost:4458').replace( | ||
/\/$/, | ||
'' | ||
) | ||
export const KRATOS_ADMIN = (Cypress.env('kratos_admin') || 'http://localhost:4434') | ||
.replace() | ||
.replace(/\/$/, '') | ||
|
||
export const KRATOS_PUBLIC = (Cypress.env('kratos_public') || 'http://localhost:4433') | ||
.replace() | ||
.replace(/\/$/, '') | ||
|
||
export const MAIL_API = (Cypress.env('mail_url') || 'http://localhost:4437').replace( | ||
/\/$/, | ||
'' | ||
) | ||
|
||
export const website = 'https://www.ory.sh/' | ||
|
||
export const gen = { | ||
email, | ||
password, | ||
identity: () => ({email: email(), password: password()}) | ||
} | ||
|
||
// Format is | ||
export const verifyHrefPattern = /^http:.*\/self-service\/verification\?(((&|)token|(&|)flow)=([\-a-zA-Z0-9]+)){2}$/ | ||
|
||
// intervals define how long to wait for something, | ||
export const pollInterval = 250 // how long to wait before retry | ||
|
||
// Adding 1+ second on top because MySQL doesn't do millisecs. | ||
export const verifyLifespan = 5000 + 1000 | ||
export const privilegedLifespan = 5000 + 1000 | ||
|
2 changes: 1 addition & 1 deletion
2
...tegration/profiles/email/error/ui.spec.js → ...tegration/profiles/email/error/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
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
Oops, something went wrong.