Browse Source

fix: Fixed issue with test

pull/6498/head
Muhammed Mustafa 1 year ago
parent
commit
46e652e5f3
  1. 9
      tests/playwright/pages/Dashboard/Form/index.ts
  2. 4
      tests/playwright/pages/Dashboard/Kanban/index.ts

9
tests/playwright/pages/Dashboard/Form/index.ts

@ -244,15 +244,6 @@ export class FormPage extends BasePage {
async verifyStatePostSubmit(param: { message?: string; submitAnotherForm?: boolean; showBlankForm?: boolean }) { async verifyStatePostSubmit(param: { message?: string; submitAnotherForm?: boolean; showBlankForm?: boolean }) {
if (undefined !== param.message) { if (undefined !== param.message) {
let retryCounter = 0;
while (retryCounter <= 5) {
const msg = await this.getFormAfterSubmit().innerText();
if (msg.includes('Form submitted successfully')) {
break;
}
await this.rootPage.waitForTimeout(100 * retryCounter);
retryCounter++;
}
await expect(this.getFormAfterSubmit()).toContainText(param.message); await expect(this.getFormAfterSubmit()).toContainText(param.message);
} }
if (true === param.submitAnotherForm) { if (true === param.submitAnotherForm) {

4
tests/playwright/pages/Dashboard/Kanban/index.ts

@ -100,9 +100,13 @@ export class KanbanPage extends BasePage {
async verifyCardOrder(param: { order: string[]; stackIndex: number }) { async verifyCardOrder(param: { order: string[]; stackIndex: number }) {
const { order, stackIndex } = param; const { order, stackIndex } = param;
const stack = this.get().locator(`.nc-kanban-stack`).nth(stackIndex); const stack = this.get().locator(`.nc-kanban-stack`).nth(stackIndex);
for (let i = 0; i < order.length; i++) { for (let i = 0; i < order.length; i++) {
const card = stack.locator(`.nc-kanban-item`).nth(i); const card = stack.locator(`.nc-kanban-item`).nth(i);
await (await card.elementHandle())?.waitForElementState('stable');
await card.scrollIntoViewIfNeeded(); await card.scrollIntoViewIfNeeded();
const cardTitle = card.locator(`.nc-cell`); const cardTitle = card.locator(`.nc-cell`);
await expect(cardTitle).toHaveText(order[i]); await expect(cardTitle).toHaveText(order[i]);

Loading…
Cancel
Save