Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix "My Account" page title
Browse files Browse the repository at this point in the history
  • Loading branch information
tarhi-saad committed Aug 15, 2023
1 parent ac7574c commit 9702ace
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/e2e/utils/frontend/frontend-utils.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,19 @@ export class FrontendUtils {

async isLoggedIn() {
await this.gotoMyAccount();
await expect( this.page ).toHaveTitle( /My account/ );
await expect( this.page ).toHaveTitle(
/My Account WooCommerce Blocks E2E Test Suite/
);
const loginForm = this.page.locator( 'form.woocommerce-form-login' );

return ! loginForm;
}

async login() {
await this.gotoMyAccount();
await expect( this.page ).toHaveTitle( /My account/ );
await expect( this.page ).toHaveTitle(
/My Account WooCommerce Blocks E2E Test Suite/
);
await this.page
.locator( 'input[name="username"]' )
.fill( customer.username );
Expand All @@ -148,7 +152,9 @@ export class FrontendUtils {

async logout() {
await this.gotoMyAccount();
await expect( this.page ).toHaveTitle( /My account/ );
await expect( this.page ).toHaveTitle(
/My Account WooCommerce Blocks E2E Test Suite/
);
await this.page.locator( 'text=Log out' ).click();
}
}

0 comments on commit 9702ace

Please sign in to comment.