Browse Source

test: pw expand record menu corrections

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5271/head
Raju Udava 2 years ago
parent
commit
bc4f1cfa4f
  1. 27
      tests/playwright/pages/Dashboard/ExpandedForm/index.ts
  2. 3
      tests/playwright/pages/Dashboard/Grid/index.ts

27
tests/playwright/pages/Dashboard/ExpandedForm/index.ts

@ -24,16 +24,25 @@ export class ExpandedFormPage extends BasePage {
return this.dashboard.get().locator(`.nc-drawer-expanded-form`); return this.dashboard.get().locator(`.nc-drawer-expanded-form`);
} }
async clickDuplicateRow() { async click3DotsMenu(menuItem: string) {
await this.duplicateRowButton.click(); await this.get().locator('.nc-icon-transition.ant-dropdown-trigger').last().click();
// add delay; wait for the menu to appear
await this.rootPage.waitForTimeout(500);
const popUpMenu = await this.rootPage.locator('.ant-dropdown');
await popUpMenu.locator(`.ant-dropdown-menu-item:has-text("${menuItem}")`).click();
}
async clickDuplicateRow() {
await this.click3DotsMenu('Duplicate Row');
// wait for loader to disappear // wait for loader to disappear
// await this.dashboard.waitForLoaderToDisappear(); // await this.dashboard.waitForLoaderToDisappear();
await this.rootPage.waitForTimeout(2000); await this.rootPage.waitForTimeout(2000);
} }
async clickDeleteRow() { async clickDeleteRow() {
await this.deleteRowButton.click(); await this.click3DotsMenu('Delete Row');
await this.rootPage.locator('.ant-btn-primary:has-text("OK")').click(); await this.rootPage.locator('.ant-btn-primary:has-text("OK")').click();
} }
@ -142,17 +151,7 @@ export class ExpandedFormPage extends BasePage {
} }
async close() { async close() {
await this.get().locator('.nc-icon-transition.ant-dropdown-trigger').last().click(); await this.click3DotsMenu('Close');
// TODO: fix this; remove the delay
// await this.rootPage.locator('.ant-dropdown').waitFor({ state: 'visible' });
// await this.rootPage.locator('.ant-dropdown').locator('.ant-dropdown-menu-item:has-text("Close")').click();
// add delay; wait for the menu to appear
await this.rootPage.waitForTimeout(500);
const popUpMenu = await this.rootPage.locator('.ant-dropdown');
await popUpMenu.locator('.ant-dropdown-menu-item:has-text("Close")').click();
} }
async openChildCard(param: { column: string; title: string }) { async openChildCard(param: { column: string; title: string }) {

3
tests/playwright/pages/Dashboard/Grid/index.ts

@ -283,6 +283,9 @@ export class GridPage extends BasePage {
}); });
await expect(await cell.locator('input')).toBeVisible(); await expect(await cell.locator('input')).toBeVisible();
// press escape to exit edit mode
await cell.press('Escape');
// right click menu // right click menu
await this.get().locator(`td[data-testid="cell-${columnHeader}-0"]`).click({ await this.get().locator(`td[data-testid="cell-${columnHeader}-0"]`).click({
button: 'right', button: 'right',

Loading…
Cancel
Save