From ec18a5117275cea0a1186d048c1fd86c86ee58f3 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 14 Oct 2022 12:18:02 +0530 Subject: [PATCH] feat(testing): Reduced flakyness --- scripts/playwright/pages/Dashboard/Grid/index.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/playwright/pages/Dashboard/Grid/index.ts b/scripts/playwright/pages/Dashboard/Grid/index.ts index 40251a782a..1717e07546 100644 --- a/scripts/playwright/pages/Dashboard/Grid/index.ts +++ b/scripts/playwright/pages/Dashboard/Grid/index.ts @@ -66,9 +66,9 @@ export class GridPage extends BasePage { .locator(`span[title="${columnHeader}"]`) .click(); - await this.rootPage.waitForResponse(async (res) => { - return (await res.json())[columnHeader] === value; - }); + await this.rootPage.waitForResponse(async (res) => { + return (await res.json())[columnHeader] === value; + }); } async verifyRow({ index }: { index: number }) { @@ -162,6 +162,11 @@ export class GridPage extends BasePage { async clickPagination({ page }: { page: string }) { (await this.pagination({ page })).click(); + + await this.rootPage.waitForResponse(async (res) => { + return (await res.json())?.pageInfo; + }); + await this.waitLoading(); }