Skip to content

Commit

Permalink
WEBUI-1604: Analyse & Make functional test 2 features files compatibl…
Browse files Browse the repository at this point in the history
…e with latest stable chrome version (#2390)
  • Loading branch information
rahuljain-dev committed Dec 12, 2024
1 parent 37440e2 commit 9ca2cac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 3 additions & 2 deletions packages/nuxeo-web-ui-ftest/features/step_definitions/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Then, When } from '@cucumber/cucumber';
When('I click the {string} button', async function(button) {
await driver.pause(1000);
const drawer = await this.ui.drawer;
const buttonToclick = await drawer.open(button);
return buttonToclick;
const output = await drawer.open(button);
output.should.be.true;
});

When('I select {string} from the View menu', async function(option) {
Expand All @@ -31,4 +31,5 @@ Then('I click the blob download button', async function() {
const page = await this.ui.browser.documentPage(this.doc.type);
const button = await page.downloadButton;
await button.click();
await driver.pause(2000);
});
16 changes: 9 additions & 7 deletions packages/nuxeo-web-ui-ftest/pages/ui/drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@ export default class Drawer extends BasePage {
}

async open(name) {
const currentMenu = await this.menu;
await currentMenu.waitForVisible();
const section = await this._section(name);
const isVisible = await section.isVisible();
if (!isVisible) {
const menu = await this.menu;
const menu = await this.menu;
let isDrawerVisible = await this.isDrawerOpened(menu);
if (isDrawerVisible) {
const buttonToclick = await menu.$(`nuxeo-menu-icon[name='${name}']`);
await buttonToclick.click();
isDrawerVisible = await this.isDrawerOpened(menu);
}
return section;
return isDrawerVisible;
}

async isDrawerOpened(menu) {
return Boolean(await menu.$(`paper-listbox[id='menu']`).getAttribute('aria-expanded'));
}

async _section(name) {
Expand Down

0 comments on commit 9ca2cac

Please sign in to comment.