From d4d2a33eb4318908c38b23171db581159d095e25 Mon Sep 17 00:00:00 2001 From: alokhyland Date: Wed, 1 May 2024 16:52:23 +0530 Subject: [PATCH] WEBUI-1507: update group test case --- packages/nuxeo-web-ui-ftest/pages/ui/group.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/nuxeo-web-ui-ftest/pages/ui/group.js b/packages/nuxeo-web-ui-ftest/pages/ui/group.js index 1d377e73e6..d667fe8ce1 100644 --- a/packages/nuxeo-web-ui-ftest/pages/ui/group.js +++ b/packages/nuxeo-web-ui-ftest/pages/ui/group.js @@ -77,10 +77,17 @@ export default class Group extends BasePage { } async searchResult(searchTerm) { - const ele = await this.el; - await driver.pause(1000); - const results = await ele.elements('nuxeo-card[name="groups"] .table [name="id"]'); - const match = await results.find(async (e) => (await e.getText()) === searchTerm); - return match; + let matchedElements; + const match = async (e) => { + const currentText = await e.getText(); + return currentText === searchTerm; + }; + await driver.waitUntil(async () => { + matchedElements = await this.el.elements('nuxeo-card[name="groups"] .table [name="id"]'); + const results = await matchedElements.some(match); + return results; + }); + + return matchedElements.find(match); } }