Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Move menu.step.js code to generic.step.js
Browse files Browse the repository at this point in the history
... because there is no menu.feature anymore
  • Loading branch information
slaweet committed Nov 9, 2017
1 parent cda5148 commit 1b61e37
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
20 changes: 20 additions & 0 deletions features/step_definitions/generic.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,25 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {
When('I scroll to the bottom', () => {
browser.executeScript('window.scrollBy(0, 10000);');
});

When('I click "{itemSelector}" in main menu', (itemSelector, callback) => {
waitForElemAndClickIt('.main-menu-icon-button');
browser.sleep(1000);
waitForElemAndClickIt(`.${itemSelector.replace(/ /g, '-')}`);
browser.sleep(1000).then(callback);
});

Then('There is no "{itemSelector}" in main menu', (itemSelector, callback) => {
waitForElemAndClickIt('.main-menu-icon-button');
browser.sleep(500);
expect(element.all(by.css(`md-menu-item .md-button.${itemSelector.replace(/ /g, '-')}`)).count()).to.eventually.equal(0)
.and.notify(callback);
});

Then('I should see in "{fieldName}" field:', (fieldName, value, callback) => {
const elem = element(by.css(`.${fieldName.replace(/ /g, '-')} textarea`));
expect(elem.getAttribute('value')).to.eventually.equal(value)
.and.notify(callback);
});
});

30 changes: 0 additions & 30 deletions features/step_definitions/menu.step.js

This file was deleted.

0 comments on commit 1b61e37

Please sign in to comment.