Skip to content

Commit

Permalink
Merge branch 'litetests' into e2e-pw
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatahalder01 committed Apr 19, 2024
2 parents f05b018 + 266449c commit 229f5b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/pw/pages/loginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export class LoginPage extends BasePage {
async logoutBackend(): Promise<void> {
await this.goIfNotThere(data.subUrls.backend.adminLogin);
await this.hover(selector.backend.userMenu);
await this.clickAndWaitForResponseAndLoadState(data.subUrls.backend.adminLogout, selector.backend.logout, 302);
await this.clickAndWaitForResponseAndLoadState(data.subUrls.backend.adminLogout, selector.backend.logout);
await this.toContainText(selector.backend.logoutSuccessMessage, 'You are now logged out.')
const loggedInUser = await this.getCurrentUser();
expect(loggedInUser).toBeUndefined();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/pw/pages/productAddonsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class ProductAddonsPage extends VendorPage {
await this.multipleElementVisible(addonsVendor.table);

await this.clickAndWaitForLoadState(addonsVendor.createNewAddon);
await this.click(addonsVendor.addon.addField);
await this.clickAndWaitForResponse(data.subUrls.ajax, addonsVendor.addon.addField);
await this.check(addonsVendor.addon.enableDescription);

// product addon fields elements are visible
Expand All @@ -53,7 +53,7 @@ export class ProductAddonsPage extends VendorPage {
await this.toContainText(addonsVendor.addon.result, addon.category);
await this.press(data.key.enter);

add ? await this.click(addonsVendor.addon.addField) : await this.click(addonsVendor.addon.addonFieldsRow('Add-on Title'));
add ? await this.clickAndWaitForResponse(data.subUrls.ajax, addonsVendor.addon.addField) : await this.click(addonsVendor.addon.addonFieldsRow('Add-on Title'));

await this.selectByValue(addonsVendor.addon.type, addon.type);
await this.selectByValue(addonsVendor.addon.displayAs, addon.displayAs);
Expand Down
6 changes: 3 additions & 3 deletions tests/pw/pages/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export const selector = {
dashboardText: '.wrap h1',

// Admin Logout
userMenu: '#wp-admin-bar-my-account',
logout: '#wp-admin-bar-logout a',
userMenu: 'li#wp-admin-bar-my-account',
logout: 'li#wp-admin-bar-logout',

// Logout Message
logoutSuccessMessage: '#login p',
logoutSuccessMessage: 'div#login-message p',

// Login Error
loginError: '#login_error',
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/utils/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ export const data = {
backend: {
login: 'wp-login.php',
adminLogin: 'wp-admin',
adminLogout: 'wp-login.php?action=logout',
adminLogout: 'wp-login.php?loggedout=true',
adminDashboard: 'wp-admin',
user: 'wp-admin/user-edit.php',
setupWP: 'wp-admin/install.php',
Expand Down

0 comments on commit 229f5b4

Please sign in to comment.