-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated Tests to cover Stake Pool Settings and Wallet Currency Display Settings screens #2622
base: develop
Are you sure you want to change the base?
Changes from 10 commits
bd3a212
57bee26
8d51456
7e43bdd
27f3f13
45593b2
7eb5338
7788106
f822ed5
f26c24d
96bb304
c07285e
579f202
7dbcd18
fe946ab
14214a2
9ba9b73
e429627
daf2d09
3f3adc1
c880921
2a678ae
00fce2a
f5f4dc7
3501c5a
0f68d01
f3df743
e30e36f
41c342e
6284b6c
e1b67fb
3d6c606
1dcbe14
37d678b
da08491
5091d6a
671f211
bb44af7
b97a867
fb3d023
56a4dc8
9132303
ff47a9e
b3d951c
a54f6e3
a20c465
9c723b9
f5aee02
b5dced4
88970fb
a4335f2
be36f43
f668343
fdcff17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@e2e @watch | ||
Feature: Wallet currency display settings | ||
|
||
Background: | ||
Given I have completed the basic setup | ||
And I have the following wallets: | ||
| name | | ||
| Test Wallet | | ||
|
||
Scenario Outline: User selects alternative currency's to display wallet balance | ||
Given I am on the General Settings "wallets" screen | ||
And I open currency selection dropdown | ||
When I select "<currency>" as the selected displayed currency | ||
And I am on the "Test Wallet" wallet "summary" screen | ||
Then I should see "<ticker>" displayed beside wallet balance | ||
|
||
Examples: | ||
| currency | ticker | | ||
| Litecoin | LTC | | ||
| Stellar | XLM | | ||
|
||
Scenario: User hits toggle button to show/not show ada wallet balance in other currency's | ||
Given I am on the General Settings "wallets" screen | ||
When I toggle the button off to change if I want to see my ada balance in other currency's | ||
Then the currency selection box is hidden | ||
And I am on the "Test Wallet" wallet "summary" screen | ||
Then The wallet summary screen does not show ada balance in other currency's placeholder | ||
When I am on the General Settings "wallets" screen | ||
And I toggle the button on to change if I want to see my ada balance in other currency's | ||
When I am on the General Settings "wallets" screen | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ManusMcCole I don't think we need multiple of these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ManusMcCole you can remove this, you are already there |
||
Then the currency selection box is visible | ||
And I am on the "Test Wallet" wallet "summary" screen | ||
Then The wallet summary screen does show ada balance in other currency's placeholder |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@e2e @watch | ||
Feature: Stake-pool server settings | ||
|
||
Background: | ||
Given I have completed the basic setup | ||
And I have the following wallets: | ||
| name | | ||
| Test Wallet | | ||
|
||
Scenario: Navigating to Stake-pool settings screen and selecting custom stake-pool server | ||
Given I am on the General Settings "stake-pools" screen | ||
When custom server is the default option | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step is not very clear. In case another option is selected, is it supposed to select the Custom option? If so, it should instead click the dropdown, then click the Custom option, rather than select the input element |
||
And The smash server input textBox is visible | ||
And I enter custom server "https://smash.cardano-testnet.iohkdev.io/" as the custom server option | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the default server for And I enter a custom server URL as custom server option and have the correct URL chosen in the JS file |
||
And I click on Daedalus logo to change focus | ||
And I click the stake-pool custom server input box submit button | ||
And I see the your changes have been saved success message | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can declare a message like "your changes have been saved" and check if that is correct. |
||
And I am on the Delegation "stake-pools" screen | ||
Then "https://smash.cardano-testnet.iohkdev.io/" is visible on stake-pool screen above stake-pool list and is clickable | ||
And I am brought back to the stake-pool server settings screen | ||
|
||
Scenario: Verify stake-pool custom server text box is visible and error message verification | ||
Given I am on the General Settings "stake-pools" screen | ||
When I open stake pool server dropdown | ||
And I select custom server option | ||
Then The smash server input textBox is visible | ||
And I enter invalid url "www.test" without https | ||
Then Stake-pool custom input box error message is displayed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe would be good to check if correct error message is shown There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, you could have something like this Then Stake-pool custom input box "https" error message is displayed And in the JS you capture Then Stake-pool custom input box "invalidUrl" error message is displayed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed now :) |
||
And I delete values in smash server custom url input box | ||
And I enter invalid server "https://www.google.ie" containing https | ||
And I click on Daedalus logo to change focus | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of declaring where you exactly clicked you can say, "I clicked outside something" |
||
And I click the stake-pool custom server input box submit button | ||
Then I see the "This url is not a valid SMASH server" error message displayed | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// @flow | ||
import { When, Then} from 'cucumber'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you execute prettier in this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ManusMcCole add a space after "Then" |
||
|
||
const CONVERTED_CURRENCY_WALLET_DISPLAY_GENERAL = '//*[@class="WalletSummaryCurrency_currencyRate"]'; | ||
const DISPLAY_BALANCE_OTHER_CURRENCYS_TOGGLE_STATUS_OFF = '//*[@class="SimpleSwitch_switch SwitchOverrides_switch"]'; | ||
const DISPLAY_BALANCE_OTHER_CURRENCYS_TOGGLE_STATUS_ON = '//*[@class="NormalSwitch_component SimpleSwitch_root SwitchOverrides_root SimpleSwitch_checked SwitchOverrides_checked"]'; | ||
const SELECT_CURRENCY_DROPDOWN = '//*[@label="Select currency"]'; | ||
|
||
When(/^I open currency selection dropdown$/, function() { | ||
return this.waitAndClick(SELECT_CURRENCY_DROPDOWN); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that you can use just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ManusMcCole for native methods, it needs |
||
}); | ||
|
||
When(/^I select "([^"]*)" as the selected displayed currency$/, function(currency) { | ||
thedanheller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return this.waitAndClick(`//*[contains(text(), "${currency}")]`); | ||
}); | ||
|
||
Then(/^I should see "([^"]*)" displayed beside wallet balance$/, function(ticker) { | ||
return this.client.waitForVisible(`//*[@class="WalletSummaryCurrency_currencyRate" and text()="${ticker}"]`); | ||
}); | ||
|
||
When(/^I toggle the button (on|off) to change if I want to see my ada balance in other currency's$/, function(switchStatus) { | ||
let selector = DISPLAY_BALANCE_OTHER_CURRENCYS_TOGGLE_STATUS_ON; | ||
if(switchStatus === 'on'){ | ||
selector = DISPLAY_BALANCE_OTHER_CURRENCYS_TOGGLE_STATUS_OFF; | ||
} | ||
return this.waitAndClick(selector); | ||
}); | ||
|
||
Then(/^the currency selection box is (hidden|visible)$/, function(state) { | ||
let invisibility = false; | ||
if (state === 'hidden') { | ||
invisibility = true; | ||
} | ||
return this.client.waitForVisible(SELECT_CURRENCY_DROPDOWN, null, invisibility); | ||
}); | ||
|
||
Then(/^The wallet summary screen (does|does not) show ada balance in other currency's placeholder$/, function(switchstatus) { | ||
let invisible = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could write this in one line The return of a comparison is always a boolean. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this solution very much. It condenses 4 lines of code in to 1 awesome 👍 |
||
if (switchstatus === 'does') { | ||
invisible = false; | ||
} | ||
return this.client.waitForVisible(CONVERTED_CURRENCY_WALLET_DISPLAY_GENERAL, null, invisible); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { When, Then,} from 'cucumber'; | ||
|
||
const CHANGES_SAVED_SUCCESS_MESSAGE = '//*[@class="StakePoolsSettings_savingResultLabel"]'; | ||
const CUSTOM_SERVER_DROPDOWN_OPTION = '//*[@class="SimpleInput_customValueWrapper"]//*[@value="Custom server"]'; | ||
const DAEDALUS_TOP_BAR_LOGO = '//*[@class="TopBar_topBar TopBar_withoutWallet"]'; | ||
const IS_ERROR_MESSAGE_ACTIVATED = '//*[@class="SimpleInput_input SimpleInput_errored"]'; | ||
const NONE_FETCH_DATA_DIRECTLY_OPTION = '//*[@class="SimpleInput_customValueWrapper"]//*[@value="None - fetch the data directly"]'; | ||
const NOT_A_VALID_SMASH_SERVER_ERROR_MESSAGE_ACTIVATED = '//*[@class="InlineEditingInput_errorMessage" and text()="This URL is not a valid SMASH server"]'; | ||
const OFF_CHAIN_METADATA_SERVER_SMASH_LABEL = '//*[contains(text(), "Off-chain metadata server (SMASH)")]'; | ||
const SMASH_SERVER_URL_INPUT_BOX = '//*[@label="SMASH server URL"]'; | ||
const STAKE_POOL_CUSTOM_SERVER_INPUT_BOX_SUBMIT_BUTTON = '//*[@class="InlineEditingInput_button InlineEditingInput_okButton SimpleButton_root ButtonOverrides_root"]'; | ||
const STAKE_POOL_CUSTOM_SERVER_INPUT_BOX_X_BUTTON = '//*[@class="InlineEditingInput_button InlineEditingInput_cancelButton SimpleButton_root ButtonOverrides_root"]'; | ||
const STAKE_POOL_SERVER_DROPDOWN = '//*[@class="SimpleFormField_inputWrapper"]'; | ||
const STAKE_POOL_SERVER_DROPDOWN_CUSTOM_OPTION = '//*[@class="ScrollbarsCustom-Content"]//span[text()="Custom server"]'; | ||
const STAKE_POOLS_SUBMENU_SETTINGS = '//*[@class="SettingsMenu_component"]//button[text()="Stake pools"]'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ManusMcCole we should avoid using text in selectors. If it can not be avoided then we should use rather use the translation directly. @daniloprates can assist you with this. |
||
|
||
When(/^none fetch the data directly is the default option$/, function() { | ||
return this.waitAndClick(NONE_FETCH_DATA_DIRECTLY_OPTION); | ||
}); | ||
|
||
When(/^custom server is the default option$/, function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @daniloprates. Thank you for the review. On my side in selfnode all i can see are options for custom and "None fetch the data directly screenshot I had presumed that it was the same for everybody. What environment variables do i need to update ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where are these environment variables set ? @daniloprates There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Manus the variable can be found at For testnet, the default server url is You can indeed use this URL for testing a custom server, but you need to check the network, because if it's testnet, it will lead to a different behaviour in the app, as it's the default server, not a custom one. In this case, you need to use another URL, like the mainnet one. |
||
return this.waitAndClick(CUSTOM_SERVER_DROPDOWN_OPTION); | ||
}); | ||
|
||
When(/^I click on Daedalus logo to change focus$/, function() { | ||
// This step was necessary as when the error message for this box is displayed the submit button could not receive the click and i got a "Element is not clickable at point error" | ||
return this.waitAndClick(DAEDALUS_TOP_BAR_LOGO); | ||
}); | ||
|
||
Then(/^"([^"]*)" is visible on stake-pool screen above stake-pool list and is clickable$/, function(serverUrl) { | ||
return this.waitAndClick('//*[@class="StakePools_smashSettings"]//span[text()="Moderated by '+ serverUrl + '"]'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to write modern Javascript you could use Template_literals this instead string concatenation https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals 😉 |
||
}); | ||
|
||
Then(/^I am brought back to the stake-pool server settings screen$/, function() { | ||
return this.client.waitForVisible(OFF_CHAIN_METADATA_SERVER_SMASH_LABEL); | ||
}); | ||
|
||
When(/^I select custom server option$/, function() { | ||
return this.waitAndClick(STAKE_POOL_SERVER_DROPDOWN_CUSTOM_OPTION); | ||
}); | ||
|
||
When(/^I open stake pool server dropdown$/, function() { | ||
return this.waitAndClick(STAKE_POOL_SERVER_DROPDOWN); | ||
}); | ||
|
||
Then(/^The smash server input textBox is visible$/, function() { | ||
return this.client.waitForVisible(SMASH_SERVER_URL_INPUT_BOX); | ||
}); | ||
|
||
When(/^I enter custom server "([^"]*)" as the custom server option$/, function(customServer) { | ||
this.client.setValue(SMASH_SERVER_URL_INPUT_BOX, customServer); | ||
}); | ||
|
||
When(/^I enter invalid url "([^"]*)" without https$/, function(invalidUrl) { | ||
this.client.setValue(SMASH_SERVER_URL_INPUT_BOX, invalidUrl); | ||
}); | ||
|
||
Then(/^Stake-pool custom input box error message is displayed$/, function() { | ||
return this.client.waitForVisible(IS_ERROR_MESSAGE_ACTIVATED); | ||
}); | ||
|
||
When(/^I enter invalid server "([^"]*)" containing https$/, function(value) { | ||
this.client.setValue(SMASH_SERVER_URL_INPUT_BOX, value); | ||
}); | ||
|
||
When(/^I delete values in smash server custom url input box$/, function() { | ||
return this.waitAndClick(STAKE_POOL_CUSTOM_SERVER_INPUT_BOX_X_BUTTON); | ||
}); | ||
|
||
When(/^I click the stake-pool custom server input box submit button$/, function() { | ||
return this.waitAndClick(STAKE_POOL_CUSTOM_SERVER_INPUT_BOX_SUBMIT_BUTTON); | ||
}); | ||
|
||
Then(/^I see the "This url is not a valid SMASH server" error message displayed$/, function() { | ||
return this.client.waitForVisible(NOT_A_VALID_SMASH_SERVER_ERROR_MESSAGE_ACTIVATED); | ||
}); | ||
|
||
When(/^I click on stakepool subtab$/, function() { | ||
return this.waitAndClick(STAKE_POOLS_SUBMENU_SETTINGS); | ||
}); | ||
|
||
Then(/^I see the your changes have been saved success message$/, function() { | ||
return this.client.waitForVisible(CHANGES_SAVED_SUCCESS_MESSAGE); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ManusMcCole Please remove the watch flag