Skip to content

Commit

Permalink
group testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
alokhyland committed May 3, 2024
1 parent 6ab9059 commit 0c36ad9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Then(/^I can search for the following groups$/, async function(table) {
const groups = await this.ui.group;
await groups.searchFor(rowFirstCol);
const resultEle = await groups.searchResult(rowFirstCol);
await driver.pause(5000);
const visible = await resultEle.waitForVisible();
if (!visible) {
throw new Error('Result not found');
Expand Down
17 changes: 12 additions & 5 deletions packages/nuxeo-web-ui-ftest/pages/ui/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
const match = async (e) => {
const currentText = await e.getText();
return currentText === searchTerm;
};
await driver.waitUntil(async () => {
const getElements = await this.el.elements('nuxeo-card[name="groups"] .table [name="id"]');
const results = await getElements.some(match);
return results;
});

const matchElementList = await this.el.elements('nuxeo-card[name="groups"] .table [name="id"]');
return matchElementList.find(match);
}
}

0 comments on commit 0c36ad9

Please sign in to comment.