Skip to content

Commit

Permalink
test ftest w3c
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuljain-dev committed Nov 27, 2024
1 parent eaac0c6 commit 4fe4306
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
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
5 changes: 3 additions & 2 deletions packages/nuxeo-web-ui-ftest/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ const capability = {
// 5 instance gets started at a time.
maxInstances: 1,
browserName: process.env.BROWSER,
// browserName: 'chrome',
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 Expand Up @@ -101,6 +101,7 @@ exports.config = {
// WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
// on a remote machine).
runner: 'local',
// specs: ['../../ftest/features/**'],
specs: [path.join(process.cwd(), './features/*.feature')],
// check http://webdriver.io/guide/testrunner/debugging.html for more info on debugging with wdio
debug: process.env.DEBUG,
Expand Down

0 comments on commit 4fe4306

Please sign in to comment.