Skip to content

Commit

Permalink
Put back missing e2e step definition
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Jan 19, 2018
1 parent 599c523 commit aebe48d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/e2e/step_definitions/generic.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,15 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {
.catch(error => console.error(`${error}`)); // eslint-disable-line no-console
optionElem.click().then(callback).catch(callback);
});

When('I select option no. {index} from "{selectName}" select', (index, selectName, callback) => {
waitForElemAndClickIt(`.${selectName}`);
browser.sleep(1000);
const selector = `.${selectName} ul li`;
const optionElem = element.all(by.css(selector)).get(index - 1);
browser.wait(EC.presenceOf(optionElem), waitTime)
.catch(error => console.error(`${error}`)); // eslint-disable-line no-console
optionElem.click().then(callback).catch(callback);
});
});

0 comments on commit aebe48d

Please sign in to comment.