Browse Source

fix: close all tabs with waitFor

pull/5537/head
Raju Udava 2 years ago
parent
commit
0d7c187774
  1. 3
      tests/playwright/pages/Dashboard/index.ts

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

@ -214,12 +214,13 @@ export class DashboardPage extends BasePage {
}
async closeAllTabs() {
await this.tabBar.locator(`.ant-tabs-tab`).waitFor({ state: 'visible' });
const tab = await this.tabBar.locator(`.ant-tabs-tab`);
const tabCount = await tab.count();
for (let i = 0; i < tabCount; i++) {
await tab.nth(i).locator('button.ant-tabs-tab-remove').click();
await this.rootPage.waitForTimeout(200);
await tab.nth(i).waitFor({ state: 'detached' });
}
}
}

Loading…
Cancel
Save