Skip to content

Commit

Permalink
test(e2e): resolve regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 7, 2022
1 parent 5029884 commit da154c5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Basic email profile with failing login flows', () => {
})

it('fails when CSRF cookies are missing', () => {
cy.get(`${appPrefix(app)}input[name="password_identifier"]`).type(
cy.get(`${appPrefix(app)}input[name="identifier"]`).type(
'i-do-not-exist'
)
cy.get('input[name="password"]').type('invalid-password')
Expand All @@ -47,7 +47,7 @@ describe('Basic email profile with failing login flows', () => {
cy.submitPasswordForm()
cy.get('*[data-testid="ui/message/4000002"]').should(
'contain.text',
'Property password_identifier is missing'
'Property identifier is missing'
)
cy.get('*[data-testid="ui/message/4000002"]').should(
'contain.text',
Expand All @@ -57,7 +57,7 @@ describe('Basic email profile with failing login flows', () => {

it('should show an error when the password is missing', () => {
const identity = gen.email()
cy.get('input[name="password_identifier"]')
cy.get('input[name="identifier"]')
.type(identity)
.should('have.value', identity)

Expand All @@ -73,7 +73,7 @@ describe('Basic email profile with failing login flows', () => {
})

it('should show fail to sign in', () => {
cy.get('input[name="password_identifier"]').type('i-do-not-exist')
cy.get('input[name="identifier"]').type('i-do-not-exist')
cy.get('input[name="password"]').type('invalid-password')

cy.submitPasswordForm()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Basic email profile with succeeding login flows', () => {
})

it('should sign in and be logged in', () => {
cy.get(`${appPrefix(app)}input[name="password_identifier"]`).type(email)
cy.get(`${appPrefix(app)}input[name="identifier"]`).type(email)
cy.get('input[name="password"]').type(password)
cy.submitPasswordForm()
cy.location('pathname').should('not.contain', '/login')
Expand All @@ -49,7 +49,7 @@ describe('Basic email profile with succeeding login flows', () => {
})

it('should sign in with case insensitive identifier surrounded by whitespace', () => {
cy.get('input[name="password_identifier"]').type(
cy.get('input[name="identifier"]').type(
' ' + email.toUpperCase() + ' '
)
cy.get('input[name="password"]').type(password)
Expand All @@ -70,7 +70,7 @@ describe('Basic email profile with succeeding login flows', () => {
cy.browserReturnUrlOry()
cy.visit(route + '?return_to=https://www.ory.sh/')

cy.get('input[name="password_identifier"]').type(email.toUpperCase())
cy.get('input[name="identifier"]').type(email.toUpperCase())
cy.get('input[name="password"]').type(password)
cy.submitPasswordForm()

Expand Down Expand Up @@ -99,7 +99,7 @@ describe('Basic email profile with succeeding login flows', () => {

cy.longLoginLifespan()

cy.get(appPrefix('express') + 'input[name="password_identifier"]').type(
cy.get(appPrefix('express') + 'input[name="identifier"]').type(
email.toUpperCase()
)
cy.get('input[name="password"]').type(password)
Expand All @@ -111,7 +111,7 @@ describe('Basic email profile with succeeding login flows', () => {
)

// try again with long lifespan set
cy.get('input[name="password_identifier"]').type(email.toUpperCase())
cy.get('input[name="identifier"]').type(email.toUpperCase())
cy.get('input[name="password"]').type(password)
cy.submitPasswordForm()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ context('UI tests using the email profile', () => {
})

it('should use the json schema titles', () => {
cy.get(`${appPrefix(app)}input[name="password_identifier"]`)
cy.get(`${appPrefix(app)}input[name="identifier"]`)
.parent()
.should('contain.text', 'ID')
cy.get('input[name="password"]')
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/cypress/integration/profiles/mfa/totp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ context('2FA lookup secrets', () => {
cy.clearAllCookies()
cy.visit(login)

cy.get('input[name="password_identifier"]').type(email)
cy.get('input[name="identifier"]').type(email)
cy.get('input[name="password"]').type(password)
cy.submitPasswordForm()

Expand Down Expand Up @@ -120,7 +120,7 @@ context('2FA lookup secrets', () => {
cy.clearAllCookies()
cy.visit(`${login}?return_to=https://www.ory.sh/`)

cy.get('input[name="password_identifier"]').type(email)
cy.get('input[name="identifier"]').type(email)
cy.get('input[name="password"]').type(password)
cy.submitPasswordForm()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ context('Mobile Profile', () => {
})

describe('shows validation errors when invalid signup data is used', () => {
it('should show an error when the password_identifier is missing', () => {
it('should show an error when the identifier is missing', () => {
cy.get('input[data-testid="password"]').type(gen.password())

cy.get('div[data-testid="submit-form"]').click()

cy.get('*[data-testid="field/password_identifier"]').should(
cy.get('*[data-testid="field/identifier"]').should(
'contain.text',
'Property password_identifier is missing.'
'Property identifier is missing.'
)

cy.get('*[data-testid="field/password"]').should(
Expand All @@ -30,7 +30,7 @@ context('Mobile Profile', () => {

it('should show an error when the password is missing', () => {
const email = gen.email()
cy.get('input[data-testid="password_identifier"]')
cy.get('input[data-testid="identifier"]')
.type(email)
.should('have.value', email)

Expand All @@ -43,7 +43,7 @@ context('Mobile Profile', () => {
})

it('should show fail to sign in', () => {
cy.get('input[data-testid="password_identifier"]').type(gen.email())
cy.get('input[data-testid="identifier"]').type(gen.email())
cy.get('input[data-testid="password"]').type(gen.password())
cy.get('*[data-testid="submit-form"]').click()
cy.get('*[data-testid="form-messages"]').should(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ context('Mobile Profile', () => {
})

it('should sign up and be logged in', () => {
cy.get('input[data-testid="password_identifier"]').type(email)
cy.get('input[data-testid="identifier"]').type(email)
cy.get('input[data-testid="password"]').type(password)
cy.get('div[data-testid="submit-form"]').click()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ context('Account Verification Login Errors', () => {
cy.registerApi(identity)
cy.visit(login)

cy.get(appPrefix(app) + '[name="password_identifier"]').type(
cy.get(appPrefix(app) + '[name="identifier"]').type(
identity.email
)
cy.get('[name="password"]').type(identity.password)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ context('Account Verification Login Success', () => {

cy.visit(login)

cy.get(appPrefix(app) + 'input[name="password_identifier"]').type(
cy.get(appPrefix(app) + 'input[name="identifier"]').type(
identity.email
)
cy.get('input[name="password"]').type(identity.password)
Expand Down

0 comments on commit da154c5

Please sign in to comment.