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

Review e2e tests - Closes #973 #974

Merged
merged 6 commits into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions features/accountManagement.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ Feature: Account management
And I refresh the page
And I should be on login page

@integration
Scenario: should allow to exit save account dialog with "cancel button"
Given I'm logged in as "any account"
When I click "save account" in main menu
And I click "cancel button"
Then I should see no "modal dialog"

@integration
Scenario: should allow to exit save account dialog with "x button"
Given I'm logged in as "any account"
When I click "save account" in main menu
Expand Down
11 changes: 4 additions & 7 deletions features/forging.feature
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
Feature: Forging tab
Scenario: should allow to view forging center if account is delegate
Scenario: should allow to view forging center if account is delegate and should show more blocks on scroll
Given I'm logged in as "delegate"
When I click tab number 3
Then I should see forging center
And I should see table with 20 lines
And I scroll to the bottom
And I should see table with 40 lines

Scenario: should show more blocks on scroll
Given I'm logged in as "delegate"
When I click tab number 3
Then I should see table with 20 lines
When I scroll to the bottom
Then I should see table with 40 lines
8 changes: 0 additions & 8 deletions features/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ Feature: Login page
Then I should be logged in
And I should see text "Mainnet" in "peer network" element

Scenario: should allow to login to Testnet
Given I'm on login page
When I fill in "wagon stock borrow episode laundry kitten salute link globe zero feed marble" to "passphrase" field
And I select option no. 2 from "network" select
And I click "login button"
Then I should be logged in
And I should see text "Testnet" in "peer network" element

Scenario: should remember the selected network
Given I'm on login page
When I fill in "wagon stock borrow episode laundry kitten salute link globe zero feed marble" to "passphrase" field
Expand Down
101 changes: 0 additions & 101 deletions features/menu.feature

This file was deleted.

35 changes: 35 additions & 0 deletions features/registerDelegate.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Feature: Register delegate
Scenario: should allow to register a delegate
Given I'm logged in as "delegate candidate"
When I click "register as delegate" in main menu
And I fill in "test" to "username" field
And I click "register button"
Then I should see alert dialog with title "Success" and text "Delegate registration was successfully submitted with username: "test". It can take several seconds before it is processed."
And I click "ok button"
And I wait 15 seconds
And I should see text "test" in "delegate name" element
And There is no "register as delegate" in main menu

Scenario: should allow to register a delegate with second passphrase
Given I'm logged in as "second passphrase account"
When I click "register as delegate" in main menu
And I fill in "test2" to "username" field
And I fill in second passphrase of "second passphrase account" to "second passphrase" field
And I click "register button"
Then I should see alert dialog with title "Success" and text "Delegate registration was successfully submitted with username: "test2". It can take several seconds before it is processed."

@integration
Scenario: should allow to exit delegate registration dialog
Given I'm logged in as "genesis"
When I click "register as delegate" in main menu
And I click "cancel button"
Then I should see no "modal dialog"

@integration
Scenario: should not allow to register delegate if not enough funds for the fee
Given I'm logged in as "empty account"
When I click "register as delegate" in main menu
Then I should see "Insufficient funds for 25 LSK fee" error message
And "register button" should be disabled


28 changes: 28 additions & 0 deletions features/registerSecondPassphrase.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Feature: Register second passphrase
Scenario: should allow to set 2nd passphrase
Given I'm logged in as "second passphrase candidate"
When I click "register second passphrase" in main menu
And I click "next button"
And I 250 times move mouse randomly
And I remember passphrase, click "next button", fill in missing word
And I click "next 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
Given I'm logged in as "second passphrase account"
Then There is no "register second passphrase" in main menu

@integration
Scenario: should not allow to set 2nd passphrase if not enough funds for the fee
Given I'm logged in as "empty account"
When I click "register second passphrase" in main menu
Then I should see "Insufficient funds for 5 LSK fee" error message
And "next button" should be disabled

@integration
Scenario: should allow to exit 2nd passphrase registration dialog
Given I'm logged in as "genesis"
When I click "register second passphrase" in main menu
And I click "cancel button"
Then I should see no "modal dialog"

17 changes: 2 additions & 15 deletions features/send.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,22 @@ Feature: Send dialog
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your transaction of 1 LSK to 537318935439898807L was accepted and will be processed in a few seconds."

@integration
Scenario: should not allow to send when not enough funds
Given I'm logged in as "empty account"
When I click "send button"
And I fill in "1" to "amount" field
And I fill in "537318935439898807L" to "recipient" field
Then I should see "Insufficient funds" error message

Scenario: should not allow to send when invalid address
Given I'm logged in as "any account"
When I click "send button"
And I fill in "1243409812409" to "recipient" field
And I fill in "1" to "amount" field
Then I should see "Invalid" error message

@integration
Scenario: should allow to exit send dialog
Given I'm logged in as "any account"
When I click "send button"
And I wait 1 seconds
And I click "cancel button"
Then I should see no "modal dialog"

Scenario: should allow to send all funds
Given I'm logged in as "send all account"
When I click "send button"
And I fill in "537318935439898807L" to "recipient" field
And I click "send maximum amount" in "transaction amount" menu
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your transaction of 100 LSK to 537318935439898807L was accepted and will be processed in a few seconds."

Scenario: should allow to send with second passphrase
Given I'm logged in as "second passphrase account"
When I click "send button"
Expand Down
33 changes: 33 additions & 0 deletions features/signMessage.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Feature: Sign message
Scenario: should allow to sign message
Given I'm logged in as "any account"
When I click "sign message" in main menu
And I fill in "Hello world" to "message" field
And I click "primary button"
Then I should see in "result" field:
"""
-----BEGIN LISK SIGNED MESSAGE-----
-----MESSAGE-----
Hello world
-----PUBLIC KEY-----
c094ebee7ec0c50ebee32918655e089f6e1a604b83bcaa760293c61e0f18ab6f
-----SIGNATURE-----
079331d868678fd5f272f09d6dc8792fb21335aec42af7f11caadbfbc17d4707e7d7f343854b0c619b647b81ba3f29b23edb4eaf382a47c534746bad4529560b48656c6c6f20776f726c64
-----END LISK SIGNED MESSAGE-----
"""

@integration
Scenario: should allow to exit sign message dialog with "cancel button"
Given I'm logged in as "any account"
When I click "sign message" in main menu
And I click "cancel button"
Then I should see no "modal dialog"

@integration
Scenario: should allow to exit sign message dialog with "x button"
Given I'm logged in as "any account"
When I click "sign message" in main menu
And I click "x button"
Then I should see no "modal dialog"


20 changes: 20 additions & 0 deletions features/step_definitions/generic.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,25 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {
When('I scroll to the bottom', () => {
browser.executeScript('window.scrollBy(0, 10000);');
});

When('I click "{itemSelector}" in main menu', (itemSelector, callback) => {
waitForElemAndClickIt('.main-menu-icon-button');
browser.sleep(1000);
waitForElemAndClickIt(`.${itemSelector.replace(/ /g, '-')}`);
browser.sleep(1000).then(callback);
});

Then('There is no "{itemSelector}" in main menu', (itemSelector, callback) => {
waitForElemAndClickIt('.main-menu-icon-button');
browser.sleep(500);
expect(element.all(by.css(`md-menu-item .md-button.${itemSelector.replace(/ /g, '-')}`)).count()).to.eventually.equal(0)
.and.notify(callback);
});

Then('I should see in "{fieldName}" field:', (fieldName, value, callback) => {
const elem = element(by.css(`.${fieldName.replace(/ /g, '-')} textarea`));
expect(elem.getAttribute('value')).to.eventually.equal(value)
.and.notify(callback);
});
});

30 changes: 0 additions & 30 deletions features/step_definitions/menu.step.js

This file was deleted.

18 changes: 0 additions & 18 deletions features/top.feature

This file was deleted.

Loading