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

Commit

Permalink
Add e2e test for voting dialog launch protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Oct 11, 2017
1 parent 7af1d7a commit 0fdcd4e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
9 changes: 9 additions & 0 deletions features/step_definitions/generic.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {
waitForElemAndCheckItsText(selectorClass, text, callback);
});

Then('I should see "{elementName}" element with text:', (elementName, text, callback) => {
const selectorClass = `.${elementName.replace(/ /g, '-')}`;
waitForElemAndCheckItsText(selectorClass, text, callback);
});

Then('I should see element "{elementName}" that contains text:', (elementName, text, callback) => {
const selectorClass = `.${elementName.replace(/ /g, '-')}`;
waitForElemAndCheckItsText(selectorClass, text, callback);
Expand All @@ -136,6 +141,10 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {
waitForElemAndClickIt('.login-button', callback);
});

When('I go to "{url}"', (url, callback) => {
browser.get(`http://localhost:8080/#${url}`).then(callback);
});

When('I {iterations} times move mouse randomly', (iterations, callback) => {
const actions = browser.actions();
/**
Expand Down
14 changes: 14 additions & 0 deletions features/voting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,17 @@ Feature: Voting tab
And I click "vote button"
And I click "cancel button"
Then I should see no "modal dialog"

Scenario: should allow to select delegates by URL
Given I'm logged in as "delegate candidate"
When I go to "/main/voting/vote?upvote=standby_27,standby_28,standby_29,nonexisting_22&downvote=standby_33"
Then I should see text "3 delegate names successfully resolved to add vote to." in "upvotes message" element
And I should see text "1 of delegate names selected for downvote were not voted for:standby_33" in "notVotedYet message" element
And I should see text "1 of entered delegate names could not be resolved:nonexisting_22" in "notFound message" element
And I should see "vote list" element with text:
"""
standby_27
standby_28
standby_29
"""

4 changes: 2 additions & 2 deletions src/components/voteDialog/voteAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export class VoteAutocompleteRaw extends React.Component {
return (
<article>
<h3 className={styles.autoCompleteTile}>{this.props.t('Add vote to')}</h3>
<div>
<div className='vote-list'>
{votedList.map(
item => <Chip key={item}
deletable
Expand Down Expand Up @@ -229,7 +229,7 @@ export class VoteAutocompleteRaw extends React.Component {
</Card>
</section>
<h3 className={styles.autoCompleteTile}>{this.props.t('Remove vote from')}</h3>
<div>
<div className='unvote-list'>
{unvotedList.map(
item => <Chip key={item}
deletable
Expand Down

0 comments on commit 0fdcd4e

Please sign in to comment.