Skip to content

Test-TUI-Governance-voting for witnesses

Test cases related to the functionality Voting for witnesses.

Preconditions:
  1. There is at least 40 witnesses (witness_01, wintess_02...). The first one should have more voted HP than the second, etc (let me know if it is impossible).
  2. Each user has:
    a. a created profile.
    b. enough RC to make a transfer.
  3. Clive is activated.

There are following users:

  • User 1 hasn't voted for any witnesses.
  • User 2 has voted for two witnesses (witness_02 and witness_03).
  • User 3 has voted for 30 witnesses (witness_01 - witness_30) - max possible value.

The each operation should be done in the following way: a. Fast broadcast. b. Finalize transaction. c. Add to cart and then broadcast.

1. Test cases: Vote for witness/es.

1.1. User 1 votes for one witness and then broadcast it (a/b/c).
test_user_with_no_votes_votes_for_one_witness

1.2. User 2 votes for one witness and then broadcast it (a/b/c).
test_user_with_two_votes_votes_for_one_witness

1.3. User 3 tries to vote for one witness - validation doesn't allow it.
test_user_with_with_max_votes_can_not_vote

1.4. User 1 votes for the first 30 witnesses (max value) and then broadcast the transaction (a/b/c).
test_user_with_no_votes_votes_for_the_max_number_of_allowed_witness

2. Test cases: Remove a vote for one witness.

2.1. User 2 removes a vote for one witness and then broadcast it (a/b/c).
test_user_with_two_votes

2.2. User 3 removes a vote for one witness and then broadcast it (a/b/c).
test_user_with_with_max_votes

3. Test cases: Add and remove votes for witnesses in the same transaction.

3.1. User 2 votes for two witnesses (witness_04 and witness_05) and removes vote for witness_02 and then broadcast the transaction (a/b/c).
test_user_with_two_votes_adds_two_votes_and_removes_one_vote

3.2. User 3 removes votes for all witnesses and votes for then witnesses that he hasn't voted before and then broadcast the transaction (a/b/c).
test_user_with_max_votes_removes_all_his_votes_and_add_votes_for_other_witnesses

4. Test cases: Pending operations (cart).

4.1. User votes for the witnesses one by one.
test_user_with_no_votes_adds_votes_for_the_witnesses_one_by_one

Steps:
  1. User 1 votes for one witness and adds the operation to the cart.
  2. User 1 goes back to the Witness View (Check of the operation is pending).
  3. User 1 votes for two witnesses and adds the operations to the cart.
  4. User 1 broadcasts the transaction with 3 operations.

4.2. User removes an operation from cart.
_test_user_with_two_votes_removes_operation_from_cart

Steps:
  1. User 2 votes for two witnesses and adds the operations to the cart.
  2. User 2 goes to the cart and removes one of the operation.
  3. User 2 goes back to the Witness View (Check of the only one operation is pending).
  4. User 2 goes to cart and broadcasts the transaction with 1 operation.

4.3. User removes votes for the witnesses one by one.
test_user_with_max_votes_removes_votes_for_the_witnesses_one_by_one

Steps:
  1. User 3 removes votes for two witnesses and adds the operation to the cart.
  2. User 3 goes back to the Witness View (Check of the operation is pending).
  3. User 3 removes votes for two witnesses and adds the operations to the cart.
  4. User 3 goes to the cart and removes one operation.
  5. User 3 broadcasts the transaction with three operations.

5. Test cases: Cart and other way of broadcast.

5.1. Cart and fast broadcast - User 2 has operations in the cart and fast broadcast another operations.
test_user_with_two_votes_has_operations_in_the_cart_and_fast_broadcast_another_operations

Steps:
  1. User 2 votes for witnesses: witness_04 and witness_05 and adds the operations to the cart.
  2. User 2 goes to the Witness View, removes the vote for wintess_02 and fast broadcasts it.
  3. To check:
    a. Operations vote for wintess_04 and witness_05 are still pending.
    b. Operation vote for wintess_02 was broadcast.

5.2. Cart and finalize transaction - User 1 has operations in the cart and then finalize transaction.
test_user_with_no_votes_has_operations_in_the_cart_and_finalizes_transaction

Steps:
  1. User 1 votes for witnesses: witness_04 and witness_05 and adds the operations to the cart.
  2. User 1 goes to the Witness View, adds the vote for wintess_02 and finalize transaction.
  3. To check:
    a. Operations vote for witness_02, wintess_04 and witness_05 were broadcast.

6. Test cases: Check if the sorting is correct.

  1. For user 2. The order should be: witness_02, witness_03 and then witness_01 and witness_04 etc.
    test_user_with_two_votes_order_by_total_votes_mine_first

7. Test cases: Check the pages of the witnesses list - vote for the last witness.

test_paging_works_

7.1. User 1 votes for the last witness.
test_voting_for_last_witness

Steps:
  1. User 1 is on the Witness View.
  2. User 1 goes to the next page of the list of witnesses.
  3. User 1 votes for the witness_40 (the last on the list).
  4. User 1 broadcasts the transaction.

8. Test cases: Searching the witnesses.

8.1. User 2: Search 'witness_01', limit = 1 - Should be one result 'witness_01'.
Check that 'Clear' removes the results.
test_searching_for_witness_01_with_limit=1

8.2. User 2: Search 'witness_1', limit = 10 - should be 10 results.
test_searching_for_witness_1_with_limit=10

9. Test cases: Check if the witness details are displayed

9.1. Check if all information about witness is displayed:
test_if_all_information_about_witness_details_is_displayed

a. Time of the query,
b. url,
c. Created,
d. Missed blocks,
e. price feed,
f. version.

Edited by Aleksandra Grabowska