Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBUI-1609: Upgrade functional test cases to make them compatible for chrome for testing browser version 131 #2392

Open
wants to merge 3 commits into
base: maintenance-3.0.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Then(/^I can see (\d+) search results$/, async function(numberOfResults) {
Then(/^I can see more than (\d+) search results$/, async function(minNumberOfResults) {
await driver.pause(1000);
const results = await this.ui.results;
await driver.pause(2000);
const displayMode = await results.displayMode;
const output = await results.resultsCount(displayMode);
if (output > minNumberOfResults) {
Expand Down
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
3 changes: 1 addition & 2 deletions packages/nuxeo-web-ui-ftest/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ const capability = {
maxInstances: 1,
browserName: process.env.BROWSER,
acceptInsecureCerts: true,
browserVersion: '130.0.6723.116',
browserVersion: 'stable',
};

const options = {};

switch (capability.browserName) {
case 'chrome':
options.args = ['--no-sandbox'];
options.w3c = false;

if (process.env.HEADLESS) {
options.args.push('--window-size=1920,1080');
Expand Down
Loading