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

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed May 31, 2017
1 parent 8e412fb commit 99f9444
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions features/step_definitions/generic.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,20 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {
});

When('I remember passphrase, click "{nextButtonSelector}", fill in missing word', (nextButtonSelector, callback) => {
waitForElemAndCheckItsText('.dialog-save h2', 'Save your passphrase in a safe place!');
waitForElemAndCheckItsText('save-passphrase h2', 'Save your passphrase in a safe place!');

element(by.css('.dialog-save textarea.passphrase')).getText().then((passphrase) => {
element(by.css('save-passphrase textarea.passphrase')).getText().then((passphrase) => {
// eslint-disable-next-line no-unused-expressions
expect(passphrase).to.not.be.undefined;
const passphraseWords = passphrase.split(' ');
expect(passphraseWords.length).to.equal(12);
waitForElemAndClickIt(`.${nextButtonSelector.replace(/ /g, '-')}`);

element.all(by.css('.dialog-save p.passphrase span')).get(0).getText().then((firstPartOfPassphrase) => {
element.all(by.css('save-passphrase p.passphrase span')).get(0).getText().then((firstPartOfPassphrase) => {
const missingWordIndex = firstPartOfPassphrase.length ?
firstPartOfPassphrase.split(' ').length :
0;
element(by.css('.dialog-save input')).sendKeys(passphraseWords[missingWordIndex]).then(callback);
element(by.css('save-passphrase input')).sendKeys(passphraseWords[missingWordIndex]).then(callback);
});
});
});
Expand Down

0 comments on commit 99f9444

Please sign in to comment.