From 3b35303c2f6d5c90c06349d11a8c24ede98337de Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 20 Mar 2024 12:54:25 +0800 Subject: [PATCH] Enable woo passwordless feature flag in Stage environment (#88610) * Enable woo-passwordless feature flag in stage * Updatew e2e tests to pass when woo passwordless feature flag is enabled --- config/stage.json | 2 +- .../calypso-e2e/src/lib/pages/signup/user-signup-page.ts | 9 +++++++-- test/e2e/specs/authentication/authentication__totp.ts | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/config/stage.json b/config/stage.json index 4d3cd5f640444..a6f10b2a9908a 100644 --- a/config/stage.json +++ b/config/stage.json @@ -194,7 +194,7 @@ "user-management-revamp": true, "videomaker-trial": true, "woop": false, - "woo/passwordless": false, + "woo/passwordless": true, "wordpress-action-search": false, "wpcom-user-bootstrap": true, "yolo/command-palette": true diff --git a/packages/calypso-e2e/src/lib/pages/signup/user-signup-page.ts b/packages/calypso-e2e/src/lib/pages/signup/user-signup-page.ts index d773c63407dfb..eec5af83af8cb 100644 --- a/packages/calypso-e2e/src/lib/pages/signup/user-signup-page.ts +++ b/packages/calypso-e2e/src/lib/pages/signup/user-signup-page.ts @@ -154,9 +154,14 @@ export class UserSignupPage { * @returns {NewUserResponse} Response from the REST API. */ async signupWoo( email: string, username: string, password: string ): Promise< NewUserResponse > { + const isWooPasswordless = await this.page.evaluate( `configData.features['woo/passwordless']` ); + await this.page.fill( selectors.emailInput, email ); - await this.page.fill( selectors.usernameInput, username ); - await this.page.fill( selectors.passwordInput, password ); + + if ( ! isWooPasswordless ) { + await this.page.fill( selectors.usernameInput, username ); + await this.page.fill( selectors.passwordInput, password ); + } const [ , response ] = await Promise.all( [ this.page.waitForURL( /.*woo\.com*/ ), diff --git a/test/e2e/specs/authentication/authentication__totp.ts b/test/e2e/specs/authentication/authentication__totp.ts index c4d800a42b3d3..c04a12c48afad 100644 --- a/test/e2e/specs/authentication/authentication__totp.ts +++ b/test/e2e/specs/authentication/authentication__totp.ts @@ -76,6 +76,11 @@ describe( DataHelper.createSuiteTitle( 'Authentication: TOTP' ), function () { it( 'Enter username', async function () { loginPage = new LoginPage( page ); await loginPage.fillUsername( credentials.username ); + + const isWooPasswordless = await page.evaluate( `configData.features['woo/passwordless']` ); + if ( isWooPasswordless ) { + await loginPage.clickSubmit(); + } } ); it( 'Enter password', async function () {