This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
voting.feature
131 lines (118 loc) · 5.35 KB
/
voting.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Feature: Voting tab
Scenario: should allow to view delegates
Given I'm logged in as "any account"
When I click tab number 2
Then I should see table with 100 lines
Scenario: should allow to view more delegates on scroll
Given I'm logged in as "any account"
When I click tab number 2
Then I should see table with 100 lines
When I scroll to the bottom
Then I should see table with 200 lines
Scenario: should allow to view delegates with cold account
Given I'm logged in as "empty account"
When I click tab number 2
Then I should see table with 100 lines
Scenario: should allow to search delegates
Given I'm logged in as "any account"
When I click tab number 2
And I fill in "genesis_42" to "search" field
Then I should see table with 1 lines
Scenario: search delegates should provide "no results" message
Given I'm logged in as "any account"
When I click tab number 2
And I fill in "doesntexist" to "search" field
Then I should see table with 0 lines
And I should see text "No delegates found" in "empty message" element
Scenario: should allow to view my votes
Given I'm logged in as "genesis"
When I click tab number 2
And I click "my votes button"
Then I should see delegates list with 101 lines
Scenario: should not allow to vote if not enough funds for the fee
Given I'm logged in as "empty account"
When I click tab number 2
And I click checkbox on table row no. 3
And I click "vote button"
Then I should see "Insufficient funds for 1 LSK fee" error message
And "submit button" should be disabled
Scenario: should display voting bar with numbers of selected votes if any selected
Given I'm logged in as "delegate candidate"
When I click tab number 2
And I should see no "voting bar"
And I click checkbox on table row no. 3
Then I should see element "voting bar" that contains text:
"""
Upvotes: 1
Downvotes: 0
Total new votes: 1 / 33
Total votes: 1 / 101
"""
And I click checkbox on table row no. 5
And I should see element "voting bar" that contains text:
"""
Upvotes: 2
Downvotes: 0
Total new votes: 2 / 33
Total votes: 2 / 101
"""
And I click checkbox on table row no. 3
And I click checkbox on table row no. 5
And I should see no "voting bar"
@testnet
Scenario: should allow to select delegates in the "Voting" tab and vote for them
Given I'm logged in as "delegate candidate"
When I click tab number 2
And I click checkbox on table row no. 3
And I click checkbox on table row no. 5
And I click checkbox on table row no. 8
And I click "vote button"
And I wait 1 seconds
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your votes were successfully submitted. It can take several seconds before they are processed."
Scenario: should allow to vote with second passphrase account
Given I'm logged in as "second passphrase account"
When I click tab number 2
And I click checkbox on table row no. 3
And I click checkbox on table row no. 5
And I click checkbox on table row no. 8
And I click "vote button"
And I fill in second passphrase of "second passphrase account" to "second passphrase" field
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your votes were successfully submitted. It can take several seconds before they are processed."
Scenario: should allow to select delegates in the "Vote" dialog and vote for them
Given I'm logged in as "delegate candidate"
When I click tab number 2
And I click "vote button"
And Search twice for "genesis_7" in vote dialog
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your votes were successfully submitted. It can take several seconds before they are processed."
Scenario: should allow to remove votes form delegates
Given I'm logged in as "genesis"
When I click tab number 2
And I click checkbox on table row no. 3
And I click checkbox on table row no. 5
And I click "vote button"
And I wait 1 seconds
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your votes were successfully submitted. It can take several seconds before they are processed."
Scenario: should allow to exit vote dialog
Given I'm logged in as "genesis"
When I click tab number 2
And I click "vote button"
And I wait 1 seconds
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?votes=standby_27,standby_28,standby_29,nonexisting_22&unvotes=standby_33"
And I wait 3 seconds
Then I should see text "3 delegate names were successfully resolved for voting." in "upvotes message" element
And I should see text "1 of the delegate names selected for unvoting was not currently voted for:standby_33" in "notVotedYet message" element
And I should see text "1 of the provided delegate names could not be resolved:nonexisting_22" in "notFound message" element
And I should see "vote list" element with text matching regexp:
"""
standby_2[789]
standby_2[789]
standby_2[789]
"""