From 640f366e824899d2b9ed9f54bb7fe83429ce288e Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Tue, 16 Jan 2018 10:38:25 +0100 Subject: [PATCH] Put back missing e2e step definition --- test/e2e/step_definitions/generic.step.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/e2e/step_definitions/generic.step.js b/test/e2e/step_definitions/generic.step.js index f1c977d478..fb2e52f588 100644 --- a/test/e2e/step_definitions/generic.step.js +++ b/test/e2e/step_definitions/generic.step.js @@ -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); + }); });