Skip to content

Azure AD B2C flows break when running in cypress #27528

@mattiasclaesson

Description

@mattiasclaesson

Current behavior

Have not been able to pinpoint why there are issues running Azure B2C flows in cypress.
For some flows it just fails, one theory would be that there is a issue with cookies.

HAR file of from within cypress:
chrome_cypress_not_working_lynkcoprod.b2clogin.com.txt

Desired behavior

The flows should work when running them thru cypress.
Har file of a working run in chrome:
chrome_working_lynkcodevelop.b2clogin.com.txt

Test code to reproduce

/// <reference types="Cypress" />

const email = '[email protected]'

describe('iam signin only password', () => {

  it('Initiate forgot password', { defaultCommandTimeout: 30000 }, () => {
    cy.visit('https://lynkcodevelop.b2clogin.com/lynkcodevelop.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_SIGNIN_ONLY&client_id=5bc3ee8d-cc20-444c-ab7e-ac3ac29d1d27&nonce=defaultNonce&redirect_uri=https%3A%2F%2Fjwt.ms&scope=openid&response_type=id_token&prompt=login')
    cy.get('#forgotPassword').click()
    cy.get('#email').type(email)
    cy.get('#continue').click()
    cy.get('#verificationCodeSentTo').contains(email)
  })

})

Cypress Version

12.17.3

Node version

v14.18.1

Operating System

windows 10

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions