Skip to content

Commit

Permalink
resolve test case random failure
Browse files Browse the repository at this point in the history
  • Loading branch information
alokhyland committed Oct 28, 2024
1 parent f259637 commit 041703f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ftest/features/publication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ Feature: Internal Publication
Then I can see the document is a publication
And I cannot see to publication pill
And I can unpublish the document
And I can see the document has 2 children
And I can see the document has 2 children
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,14 @@ Then('I edit the results columns to show {string}', async function(heading) {
});

Then(/^I save my search as "(.+)"$/, async function(searchName) {
const saveAsButton = await this.ui.searchResults.saveSearchAsButton;
const searchResults = await this.ui.searchResults;
const saveAsButton = await searchResults.saveSearchAsButton;
await saveAsButton.waitForVisible();
await saveAsButton.click();
await this.ui.searchResults.enterInput(searchName);
const confirmSaveButton = await this.ui.searchResults.confirmSaveSearchButton;
await driver.pause(2000);
await searchResults.enterInput(searchName);
await driver.pause(2000);
const confirmSaveButton = await searchResults.confirmSaveSearchButton;
await confirmSaveButton.click();
});

Expand Down
2 changes: 2 additions & 0 deletions packages/nuxeo-web-ui-ftest/pages/ui/admin/cloudServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export default class CloudServices extends BasePage {
}

async deleteClient(clientId) {
const dataTable = await driver.$('nuxeo-data-table nuxeo-data-table-row [name="id"]');
await dataTable.waitForVisible();
const rows = await browser.$$('nuxeo-data-table[name="table"] nuxeo-data-table-row:not([header])');
const deleted = await browser
.$$('nuxeo-data-table[name="table"] nuxeo-data-table-row:not([header])')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export default class DocumentPublications extends BasePage {
let index;
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
if (row.isVisible('nuxeo-data-table-cell a.path')) {
const isRowVisible = await row.isVisible('nuxeo-data-table-cell a.path');
if (isRowVisible) {
const foundPathEle = await row.$('nuxeo-data-table-cell a.path');
const foundPath = await foundPathEle.getText();
const foundPathLowerCase = await foundPath.trim().toLowerCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export default class DocumentVersions extends BasePage {
return true;
}
const listItems = await this.listItems;
await listItems.$('div[name="version-item"] .title').waitForVisible();
const versionItem = await listItems.$('div[name="version-item"] .title');
await versionItem.waitForVisible();
const listItems1 = await this.listItems.$$('div[name="version-item"]');
const itemsTitle = await browser.$$('div[name="version-item"]').map((img) => img.$('.title').getText());
const index = itemsTitle.findIndex((currenTitle) => currenTitle === label);
Expand Down
5 changes: 3 additions & 2 deletions packages/nuxeo-web-ui-ftest/pages/ui/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ export default class Search extends Results {
return dropdownElenent;
}

enterInput(text) {
return driver.keys(text);
async enterInput(text) {
const isInputEntered = await driver.keys(text);
return isInputEntered;
}

async getField(field) {
Expand Down

0 comments on commit 041703f

Please sign in to comment.