diff --git a/features/accountManagement.feature b/features/accountManagement.feature index bfcae7f92..dfb3c5005 100644 --- a/features/accountManagement.feature +++ b/features/accountManagement.feature @@ -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 diff --git a/features/forging.feature b/features/forging.feature index 3e9abe259..d3241cd73 100644 --- a/features/forging.feature +++ b/features/forging.feature @@ -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 diff --git a/features/login.feature b/features/login.feature index 3c5c1c88e..94c40d587 100644 --- a/features/login.feature +++ b/features/login.feature @@ -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 diff --git a/features/menu.feature b/features/menu.feature deleted file mode 100644 index 70034a133..000000000 --- a/features/menu.feature +++ /dev/null @@ -1,101 +0,0 @@ -Feature: Top right menu - 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 - - 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 - - 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" - - 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 - - Scenario: should not allow to register a delegate again - Given I'm logged in as "delegate" - Then 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." - - 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" - - 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 - - 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----- - """ - - 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" - - 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" - - Scenario: should allow to verify message - Given I'm logged in as "any account" - When I click "verify message" in main menu - And I fill in "c094ebee7ec0c50ebee32918655e089f6e1a604b83bcaa760293c61e0f18ab6f" to "public key" field - And I fill in "079331d868678fd5f272f09d6dc8792fb21335aec42af7f11caadbfbc17d4707e7d7f343854b0c619b647b81ba3f29b23edb4eaf382a47c534746bad4529560b48656c6c6f20776f726c64" to "signature" field - Then I should see "Hello world" in "result" field - - Scenario: should allow to exit verify message dialog - Given I'm logged in as "any account" - When I click "verify message" in main menu - And I click "x button" - Then I should see no "modal dialog" diff --git a/features/registerDelegate.feature b/features/registerDelegate.feature new file mode 100644 index 000000000..f5b0459c2 --- /dev/null +++ b/features/registerDelegate.feature @@ -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 + + diff --git a/features/registerSecondPassphrase.feature b/features/registerSecondPassphrase.feature new file mode 100644 index 000000000..66826c240 --- /dev/null +++ b/features/registerSecondPassphrase.feature @@ -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" + diff --git a/features/send.feature b/features/send.feature index 02b80d7b0..c44e836aa 100644 --- a/features/send.feature +++ b/features/send.feature @@ -8,6 +8,7 @@ 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" @@ -15,13 +16,7 @@ Feature: Send dialog 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" @@ -29,14 +24,6 @@ Feature: Send dialog 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" diff --git a/features/signMessage.feature b/features/signMessage.feature new file mode 100644 index 000000000..142b955e9 --- /dev/null +++ b/features/signMessage.feature @@ -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" + + diff --git a/features/step_definitions/generic.step.js b/features/step_definitions/generic.step.js index ae58a643a..6c976a2c7 100644 --- a/features/step_definitions/generic.step.js +++ b/features/step_definitions/generic.step.js @@ -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); + }); }); diff --git a/features/step_definitions/menu.step.js b/features/step_definitions/menu.step.js deleted file mode 100644 index 14a76d194..000000000 --- a/features/step_definitions/menu.step.js +++ /dev/null @@ -1,30 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -const { defineSupportCode } = require('cucumber'); -const chai = require('chai'); -const chaiAsPromised = require('chai-as-promised'); -const { waitForElemAndClickIt } = require('../support/util.js'); - -chai.use(chaiAsPromised); -const expect = chai.expect; - -defineSupportCode(({ When, Then }) => { - 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); - }); -}); diff --git a/features/top.feature b/features/top.feature deleted file mode 100644 index 55b17c173..000000000 --- a/features/top.feature +++ /dev/null @@ -1,18 +0,0 @@ -Feature: Main page top area - Scenario: should allow to logout - Given I'm logged in as "any account" - When I click "logout button" - Then I should be on login page - - Scenario: should show peer - Given I'm logged in as "any account" - Then I should see text "Custom Node" in "peer network" element - - Scenario: should show address - Given I'm logged in as "genesis" - Then I should see text "16313739661670634666L" in "address" element - - Scenario: should show balance - Given I'm logged in as "empty account" - Then I should see text "0 LSK" in "balance value" element - diff --git a/features/transactions.feature b/features/transactions.feature index 267ef7f62..6e6bd8f24 100644 --- a/features/transactions.feature +++ b/features/transactions.feature @@ -1,16 +1,12 @@ Feature: Transactions tab - Scenario: should show transactions - Given I'm logged in as "genesis" - When I click tab number 1 - Then I should see table with 40 lines - - Scenario: should show more transactions on scroll + Scenario: should show transactions and more on scroll Given I'm logged in as "genesis" When I click tab number 1 Then I should see table with 40 lines When I scroll to the bottom Then I should see table with 60 lines + @integration Scenario: should allow send to address Given I'm logged in as "genesis" When I click tab number 1 @@ -19,6 +15,7 @@ Feature: Transactions tab 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 @pending Scenario: should allow to repeat the transaction Given I'm logged in as "genesis" @@ -28,15 +25,11 @@ Feature: Transactions tab 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." - Scenario: should provide "No transactions" message - Given I'm logged in as "empty account" - When I click tab number 1 - Then I should see table with 0 lines - And I should see text "There are no transactions, yet. RECEIVE LSK" in "empty message" element - Scenario: should provide "Receive LSK" modal if there are "No transactions" Given I'm logged in as "empty account" When I click tab number 1 + And I should see table with 0 lines + And I should see text "There are no transactions, yet. RECEIVE LSK" in "empty message" element And I click "receive lsk button" And I wait 1 seconds Then I should see text "5932438298200837883L" in "receive modal address" element diff --git a/features/verifyMessage.feature b/features/verifyMessage.feature new file mode 100644 index 000000000..fc2098a55 --- /dev/null +++ b/features/verifyMessage.feature @@ -0,0 +1,15 @@ +Feature: Verify message + Scenario: should allow to verify message + Given I'm logged in as "any account" + When I click "verify message" in main menu + And I fill in "c094ebee7ec0c50ebee32918655e089f6e1a604b83bcaa760293c61e0f18ab6f" to "public key" field + And I fill in "079331d868678fd5f272f09d6dc8792fb21335aec42af7f11caadbfbc17d4707e7d7f343854b0c619b647b81ba3f29b23edb4eaf382a47c534746bad4529560b48656c6c6f20776f726c64" to "signature" field + Then I should see "Hello world" in "result" field + + @integration + Scenario: should allow to exit verify message dialog + Given I'm logged in as "any account" + When I click "verify message" in main menu + And I click "x button" + Then I should see no "modal dialog" + diff --git a/features/voting.feature b/features/voting.feature index 78dbb3d5d..56a6d0aa7 100644 --- a/features/voting.feature +++ b/features/voting.feature @@ -1,10 +1,5 @@ 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 + Scenario: should allow to view delegates and more on scroll Given I'm logged in as "any account" When I click tab number 2 Then I should see table with 100 lines @@ -21,20 +16,19 @@ Feature: Voting tab 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 clear "search" field And I fill in "doesntexist" to "search" field - Then I should see table with 0 lines + And I should see table with 0 lines And I should see text "No delegates found" in "empty message" element + @integration 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 + @integration 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 @@ -43,6 +37,7 @@ Feature: Voting tab Then I should see "Insufficient funds for 1 LSK fee" error message And "submit button" should be disabled + @integration 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 @@ -90,6 +85,8 @@ Feature: Voting tab 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." + @integration + @pending 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 @@ -98,6 +95,7 @@ Feature: Voting tab 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." + @integration Scenario: should allow to remove votes form delegates Given I'm logged in as "genesis" When I click tab number 2 @@ -108,6 +106,7 @@ Feature: Voting tab 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." + @integration Scenario: should allow to exit vote dialog Given I'm logged in as "genesis" When I click tab number 2