Skip to content

Commit

Permalink
changes group testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
alokhyland committed May 1, 2024
1 parent 6ab9059 commit e1d4b36
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/nuxeo-web-ui-ftest/features/step_definitions/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { Then, When } from '@cucumber/cucumber';

When(/^I select group from the dropdown menu$/, async function() {
When(/^I select group from the dropdown menu$/, async function () {
const groupELe = this.ui.group;
const groupDropEle = await groupELe.dropdown;
await groupDropEle.waitForVisible();
const groupItemEle = await groupELe.groupItem;
await groupItemEle.click();
});

When(/^I can see the new group form$/, async function() {
When(/^I can see the new group form$/, async function () {
const groupELe = this.ui.group;
const groupFormEle = await groupELe.createGroupForm;
await groupFormEle.waitForVisible();
});

Then(/^I can create a group with the following properties:$/, async function(table) {
Then(/^I can create a group with the following properties:$/, async function (table) {
const groupELe = this.ui.group;
await groupELe.fillMultipleValues(table);
const groupButtonEle = await groupELe.createGroupButton;
await groupButtonEle.click();
});

Then(/^I can search for the following groups$/, async function(table) {
Then(/^I can search for the following groups$/, async function (table) {
const rows = await table.rows();
for (let i = 0; i < rows.length; i++) {
const row = await rows[i];
const rowFirstCol = await row[0];
const groups = await this.ui.group;
await groups.searchFor(rowFirstCol);
const resultEle = await groups.searchResult(rowFirstCol);
await driver.pause(3000);
const visible = await resultEle.waitForVisible();
if (!visible) {
throw new Error('Result not found');
Expand All @@ -50,7 +51,7 @@ Then(/^I can search for the following groups$/, async function(table) {
}
});

Then(/^I can edit the following groups$/, async function(table) {
Then(/^I can edit the following groups$/, async function (table) {
const rows = await table.rows();
for (let i = 0; i < rows.length; i++) {
const row = await rows[i];
Expand All @@ -71,7 +72,7 @@ Then(/^I can edit the following groups$/, async function(table) {
}
});

Then(/^I can delete the following groups$/, async function(table) {
Then(/^I can delete the following groups$/, async function (table) {
const rows = await table.rows();
for (let i = 0; i < rows.length; i++) {
const row = await rows[i];
Expand Down

0 comments on commit e1d4b36

Please sign in to comment.