Skip to content

Commit

Permalink
Enable woo passwordless feature flag in Stage environment (#88610)
Browse files Browse the repository at this point in the history
* Enable woo-passwordless feature flag in stage

* Updatew e2e tests to pass when woo passwordless feature flag is enabled
  • Loading branch information
chihsuan authored Mar 20, 2024
1 parent ae3fdab commit 3b35303
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions packages/calypso-e2e/src/lib/pages/signup/user-signup-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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*/ ),
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/specs/authentication/authentication__totp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 3b35303

Please sign in to comment.