Skip to content

Commit

Permalink
Fix flaky new account e2e test - Closes #135
Browse files Browse the repository at this point in the history
the problem was that the same class name (.next-button) was used for multiple buttons
in different steps and e2e tests were getting the button from the
previous step, because it was still in the DOM because of hide animation
  • Loading branch information
slaweet committed Dec 21, 2017
1 parent 573e276 commit dc78e69
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/passphrase/confirm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class Confirm extends React.Component {
<PrimaryButton
theme={styles}
label={this.props.t('Get to your Dashboard')}
className="next-button"
className="get-to-your-dashboard-button"
onClick={() => this.props.finalCallback({ passphrase: words.join(' ') })}
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/passphrase/confirm/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Passphrase: Confirm', () => {
});
wrapper.update();

const wrapperProps = wrapper.find('button.next-button').props();
const wrapperProps = wrapper.find('button.get-to-your-dashboard-button').props();
expect(wrapperProps.disabled).to.be.equal(true);
});

Expand All @@ -83,7 +83,7 @@ describe('Passphrase: Confirm', () => {
});
wrapper.update();

const wrapperProps = wrapper.find('button.next-button').props();
const wrapperProps = wrapper.find('button.get-to-your-dashboard-button').props();
expect(wrapperProps.disabled).to.not.be.equal(true);
});
});
2 changes: 1 addition & 1 deletion src/components/passphrase/create/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class Create extends React.Component {
<PrimaryButton
theme={styles}
label='Get passphrase'
className="next-button"
className="get-passphrase-button"
onClick={() => nextStep({ passphrase: this.state.passphrase })}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/passphrase/safekeeping/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PassphraseShow extends React.Component {
}}
primaryButton={{
label: t('Yes! It\'s safe'),
className: 'next-button',
className: 'yes-its-safe-button',
onClick: () => nextStep({ passphrase }),
}} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/passphrase/safekeeping/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('Passphrase: Safekeeping', () => {
});

it('should call nextStep if Next button clicked', () => {
wrapper.find('button.next-button').simulate('click');
wrapper.find('button.yes-its-safe-button').simulate('click');
expect(props.nextStep).to.have.been.calledWith();
});
});
6 changes: 3 additions & 3 deletions test/e2e/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Feature: Login page
And I wait 1 seconds
And I 250 times move mouse randomly
And I wait 2 seconds
And I click "next button"
And I click "get passphrase button"
And I swipe "i understand checkbox" to right
And I swipe "reveal checkbox" to right
And I remember passphrase, click "next button", choose missing words
And I click "next button"
And I remember passphrase, click "yes its safe button", choose missing words
And I click "get to your dashboard button"
Then I should be logged in
8 changes: 5 additions & 3 deletions test/e2e/registerSecondPassphrase.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Feature: Register second passphrase
When I click "register second passphrase" in main menu
And I click "next button"
And I 250 times move mouse randomly
And I click "next button"
And I remember passphrase, click "next button", fill in missing word
And I click "next button"
And I click "get passphrase button"
And I swipe "i understand checkbox" to right
And I swipe "reveal checkbox" to right
And I remember passphrase, click "yes its safe button", choose missing words
And I click "get to your dashboard button"
Then I should see alert dialog with title "Success" and text "Second passphrase registration was successfully submitted. It can take several seconds before it is processed."

Scenario: should not allow to set 2nd passphrase again
Expand Down

0 comments on commit dc78e69

Please sign in to comment.