Update tests to use new selectors, implement reporting
. Use accessible ID's to identify elements . Implement reporting . Clean up . Input more notes in README.md
This commit is contained in:
@@ -43,7 +43,7 @@ export const BalanceCard = () => {
|
||||
{getBalance.error}
|
||||
</Alert>
|
||||
) : (
|
||||
<Typography variant="h6">
|
||||
<Typography variant="h6" data-testid="account-balance">
|
||||
{getBalance.balance?.printable_balance}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
@@ -13,6 +13,7 @@ export const NymCard: React.FC<{
|
||||
<CardHeader
|
||||
title={title}
|
||||
subheader={subheader}
|
||||
data-testid={title}
|
||||
titleTypographyProps={{ variant: 'h5' }}
|
||||
subheaderTypographyProps={{ variant: 'subtitle1' }}
|
||||
action={Action}
|
||||
|
||||
@@ -96,7 +96,7 @@ export const Delegate = () => {
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
data-testid="finishButton"
|
||||
data-testid="finish-button"
|
||||
onClick={() => {
|
||||
setStatus(EnumRequestStatus.initial)
|
||||
}}
|
||||
|
||||
@@ -44,19 +44,19 @@ export const SendReview = () => {
|
||||
) : (
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<SendReviewField title="From" subtitle={values.from} data-testid="from-address" />
|
||||
<SendReviewField title="From" subtitle={values.from}/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider light />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<SendReviewField title="To" subtitle={values.to} data-testid="to-address"/>
|
||||
<SendReviewField title="To" subtitle={values.to} />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider light />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<SendReviewField title="Amount" subtitle={values.amount} data-testid="transfer-amount"/>
|
||||
<SendReviewField title="Amount" subtitle={values.amount} />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider light />
|
||||
@@ -65,7 +65,6 @@ export const SendReview = () => {
|
||||
<SendReviewField
|
||||
title="Transfer fee"
|
||||
subtitle={transferFee + ' PUNK'}
|
||||
data-testid="transfer-fee"
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -87,7 +86,7 @@ export const SendReviewField = ({
|
||||
<Typography style={{ color: theme.palette.grey[600] }}>
|
||||
{title}
|
||||
</Typography>
|
||||
<Typography style={{ wordBreak: 'break-all' }}>{subtitle}</Typography>
|
||||
<Typography data-testid={title} style={{ wordBreak: 'break-all' }}>{subtitle}</Typography>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ const SignInContent = ({
|
||||
return (
|
||||
<SignInCard>
|
||||
<>
|
||||
<Typography variant="h4">Sign in</Typography>
|
||||
<Typography variant="h4" data-testid="sign-in">Sign in</Typography>
|
||||
<form noValidate onSubmit={handleSignIn}>
|
||||
<Grid container direction="column" spacing={1}>
|
||||
<Grid item>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
reports
|
||||
allure-results
|
||||
node_modules
|
||||
.vscode
|
||||
.idea
|
||||
@@ -3,13 +3,11 @@ Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
# Nym Tauri Wallet Webdriver testsuite
|
||||
# Nym Wallet Webdriverio testsuite
|
||||
|
||||
A webdriverio test suite implementation using tauri driver
|
||||
with a page object model design. This project is to provide quick iterative feedback
|
||||
on the UI of the tauri nym wallet.
|
||||
|
||||
Currently, tauri-driver is available to run on Windows and Linux machines.
|
||||
with a page object model design. This is to provide quick iterative feedback
|
||||
on the UI of the nym wallet. Currently, tauri-driver is available to run on Windows and Linux machines.
|
||||
|
||||
## Installation prerequisites
|
||||
* `Yarn`
|
||||
@@ -17,7 +15,7 @@ Currently, tauri-driver is available to run on Windows and Linux machines.
|
||||
* `Rust & cargo >= v1.51`
|
||||
* `tauri-driver`
|
||||
* `That you have an existing mnemonic and you can login to the app`
|
||||
* `Have the details listed below to provide the user-data.js file`
|
||||
* `Have the details listed below to provide the user-data.json file`
|
||||
|
||||
|
||||
## Key Information
|
||||
@@ -40,8 +38,8 @@ built successfully, if so, you will have an executable sitting in the target dir
|
||||
|
||||
## Installation & usage
|
||||
* `test excution happens inside /webdriver directory`
|
||||
* `test data needs to be provided inside the user-data.js module`
|
||||
* `check the wdio.conf.js to see the activities and path location of the binary`
|
||||
* `test data needs to be provided inside the user-data.json`
|
||||
* `check the wdio.conf.cjs to see the activities and path location of the binary`
|
||||
```
|
||||
example:
|
||||
//mnemonic is a base64 enconded value, which is your 24 character passphrase, these values are for illustration purposes
|
||||
@@ -49,24 +47,35 @@ example:
|
||||
"mnemonic" : "dGhpcyBpcyBhIHBhc3NwaHJhc2UK",
|
||||
"punk_address" : "punk1f3dzkhmunma5ze5q952daxca6371989189",
|
||||
"receiver_address" : "punk1p0ce82jxxglpmutvhq4mdwgcwf4avm5n1821982",
|
||||
"amount_to_send" : "5",
|
||||
"identity_key_to_delegate":"value",
|
||||
"identity_key_to_delegate_gateway" : "value"
|
||||
"amount_to_send" : "1",
|
||||
"identity_key_to_delegate_mix_node": "value",
|
||||
"identity_key_to_delegate_gateway" : "value",
|
||||
"delegate_amount" : "1"
|
||||
}
|
||||
```
|
||||
* `yarn test:runall` - the first test run will take some time to spin up be patient
|
||||
* You can run tests individually by passing through the script situated in the package.json for example `yarn test:delegate`
|
||||
* You can run tests individually by passing through the script situated in the package.json for example `yarn test:newuser`
|
||||
|
||||
Tests are categorised and run by their pages, they follow a sequential flow, if one test case fails before the next execution it may derail the next test.
|
||||
//todo improve in near future
|
||||
|
||||
## Test reporting
|
||||
Currently the tests use allure reporting, the configuration can be altered in the `wdio.conf.cjs`. At present it takes snapshots of any failing tests, the test output run can be seen in the allure-results directory
|
||||
Tests ouput:
|
||||
* <guid-testuite.xml>
|
||||
* <guid-attachment.png>
|
||||
|
||||
If any tests fail in their test run it will produce the stack trace error along with the test in question
|
||||
|
||||
## Updates
|
||||
|
||||
Disclaimer: As this project is WIP, there's a lot due to be updated and modified. This is to get the project up and running.
|
||||
*Disclaimer*: Still WIP
|
||||
|
||||
|
||||
Refactoring needs to take place in certain areas to reduce code duplication, tidying up selectors and improving performance, implement error handling
|
||||
Refactoring needs to take place in certain areas, implement error handling/ beforeTest() - validating json file exists with data for test execution
|
||||
|
||||
|
||||
Configuration for happy path and non happy path (non bonded users needs to happen)
|
||||
|
||||
|
||||
Currently this project has been dev'd against a Linux based OS, not currently tested against Windows.
|
||||
Currently this is dev'd against a Linux based OS, not tested against windows yet.
|
||||
|
||||
@@ -10,6 +10,7 @@ module.exports = {
|
||||
"homePageErrorMnemonic": "Error parsing bip39 mnemonic",
|
||||
"homePageSignIn" : "Sign in",
|
||||
"createOne" : "Create one",
|
||||
"walletSuccess" : "Please store your mnemonic in a safe place. You'll need it to access your wallet",
|
||||
|
||||
//bondPage // unbondPage
|
||||
"bondAlreadyNoded" : "Looks like you already have a mixnode bonded.",
|
||||
@@ -20,10 +21,9 @@ module.exports = {
|
||||
//balancePage
|
||||
|
||||
//delegatePage // undelegatePage
|
||||
"delegateHeaderText" : "Delegate to mixnode or gateway",
|
||||
"delegateHeaderText" : "Delegate\nDelegate to mixnode or gateway",
|
||||
"nodeIdentityValidationText" : "identity is a required field",
|
||||
"amountValidationText": "amount is a required field",
|
||||
//"transferFeeAmount" : "A fee of 0.004375 PUNK will apply to this transaction",
|
||||
"undelegateHeaderText" : "Undelegate from a mixnode or gateway",
|
||||
"delegationComplete" : "Delegation complete"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
module.exports = {
|
||||
"mnemonic": "",
|
||||
"punk_address": "",
|
||||
"receiver_address": "",
|
||||
"amount_to_send": "",
|
||||
"identity_key_to_delegate": "",
|
||||
"delegate_amount": ""
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"mnemonic": "value",
|
||||
"punk_address": "",
|
||||
"receiver_address": "",
|
||||
"amount_to_send": "",
|
||||
"identity_key_to_delegate_mix_node": "",
|
||||
"identity_key_to_delegate_gateway" : "",
|
||||
"delegate_amount": ""
|
||||
}
|
||||
@@ -5,21 +5,21 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test:runall": "wdio run wdio.conf.cjs",
|
||||
"test:sendreceive": "wdio run wdio.conf.cjs --suite sendAndReceive",
|
||||
"test:login": "wdio run wdio.conf.cjs --suite login",
|
||||
"test:sendreceive": "wdio run wdio.conf.cjs --suite sendreceive",
|
||||
"test:home": "wdio run wdio.conf.cjs --suite home",
|
||||
"test:bond": "wdio run wdio.conf.cjs --suite bond",
|
||||
"test:delegate": "wdio run wdio.conf.cjs --suite delegate",
|
||||
"test:newaccounts": "wdio run wdio.conf.cjs --suite nonExsistingUser"
|
||||
"test:newuser": "wdio run wdio.conf.cjs --suite newuser"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^16.11.0",
|
||||
"@wdio/allure-reporter": "^7.16.1",
|
||||
"@wdio/cli": "^7.9.1",
|
||||
"@zxing/browser": "^0.0.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@wdio/local-runner": "^7.14.1",
|
||||
"@wdio/mocha-framework": "^7.14.1",
|
||||
"@wdio/spec-reporter": "^7.14.1",
|
||||
"wdio-chromedriver-service": "^7.2.2"
|
||||
"@wdio/spec-reporter": "^7.14.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,18 @@
|
||||
class WalletBond {
|
||||
|
||||
get header() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span.MuiTypography-root.MuiCardHeader-subheader.MuiTypography-subtitle1.MuiTypography-colorTextSecondary.MuiTypography-displayBlock");
|
||||
}
|
||||
|
||||
get identityKey() {
|
||||
return $("#identityKey");
|
||||
}
|
||||
|
||||
get sphinxKey() {
|
||||
return $("#sphinxKey");
|
||||
}
|
||||
|
||||
get amountToBond() {
|
||||
return $("#amount");
|
||||
}
|
||||
|
||||
get hostInput() {
|
||||
return $("#host")
|
||||
}
|
||||
|
||||
get versionInput() {
|
||||
return $("version");
|
||||
}
|
||||
|
||||
get advancedOptions() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div.MuiFormControl-root.MuiFormControl-fullWidth > div:nth-child(1) > div > div:nth-child(8) > label > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-13.MuiCheckbox-root.MuiCheckbox-colorSecondary.MuiIconButton-colorSecondary > span.MuiIconButton-label > input");
|
||||
}
|
||||
|
||||
get selectAdvancedOptions() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div.MuiFormControl-root.MuiFormControl-fullWidth > div:nth-child(1) > div > div:nth-child(8) > label > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-7.MuiCheckbox-root.MuiCheckbox-colorSecondary.MuiIconButton-colorSecondary");
|
||||
|
||||
}
|
||||
|
||||
get mixPort() {
|
||||
return $("#mixPort");
|
||||
}
|
||||
|
||||
get verlocPort() {
|
||||
return $("#verlocPort");
|
||||
}
|
||||
|
||||
get httpApiPort() {
|
||||
return $("#httpApiPort");
|
||||
}
|
||||
|
||||
get bondButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div.MuiFormControl-root.MuiFormControl-fullWidth > div:nth-child(2) > button");
|
||||
}
|
||||
|
||||
get unBondButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div.MuiAlert-action > button > span.MuiButton-label");
|
||||
}
|
||||
|
||||
get unBondInformation(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div.MuiAlert-message");
|
||||
}
|
||||
get header() { return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span.MuiTypography-root.MuiCardHeader-subheader.MuiTypography-subtitle1.MuiTypography-colorTextSecondary.MuiTypography-displayBlock"); }
|
||||
get identityKey() { return $("#identityKey") }
|
||||
get sphinxKey() { return $("#sphinxKey") }
|
||||
get amountToBond() { return $("#amount") }
|
||||
get hostInput() { return $("#host") }
|
||||
get versionInput() { return $("version") }
|
||||
get selectAdvancedOptions() { return $("[class='PrivateSwitchBase-input-20']") }
|
||||
get mixPort() { return $("#mixPort") }
|
||||
get verlocPort() { return $("#verlocPort") }
|
||||
get httpApiPort() { return $("#httpApiPort") }
|
||||
get bondButton() { return $("[data-testid='bond-button']") }
|
||||
get unBondButton() { return $("[data-testid='unbond-button']") }
|
||||
get unBondInformation() { return $("[data-testid='bond-noded']") }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
class WalletCreate {
|
||||
|
||||
get createAccount() {return $('#root > div > div:nth-child(2) > div > div > div:nth-child(2) > button.MuiButtonBase-root.MuiButton-root.MuiButton-contained.MuiButton-containedPrimary.MuiButton-disableElevation.MuiButton-fullWidth > span.MuiButton-label')}
|
||||
|
||||
get accountCreatedSuccessfully() { return $('#root > div > div:nth-child(2) > div > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-center > div:nth-child(1) > p')}
|
||||
|
||||
get walletMnemonicCreated() {return $('#root > div > div:nth-child(2) > div > p')}
|
||||
|
||||
get walletMnemonicValue(){ return $('#root > div > div:nth-child(2) > div > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-center > div.MuiPaper-root.MuiCard-root.MuiPaper-outlined.MuiPaper-rounded > div > div:nth-child(2) > p')}
|
||||
|
||||
get punkAddress(){ return $('#root > div > div:nth-child(2) > div > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-center > div.MuiPaper-root.MuiCard-root.MuiPaper-outlined.MuiPaper-rounded > div > div:nth-child(5) > p')}
|
||||
|
||||
get backToSignIn() {return $('#root > div > div:nth-child(2) > div > div > div:nth-child(2) > button > span.MuiButton-label')}
|
||||
|
||||
get signInButton() {return $('[data-testid="sign-in-button"]')}
|
||||
|
||||
get createAccount() { return $("[href='#']") }
|
||||
get create() { return $("[data-testid='create-button']") }
|
||||
get accountCreatedSuccessfully() { return $("[data-testid='mnemonic-warning']") }
|
||||
get walletMnemonicValue() { return $("[data-testid='mnemonic-phrase']") }
|
||||
get punkAddress() { return $("[data-testid='wallet-address']") }
|
||||
get backToSignIn() { return $("[data-testid='sign-in-button']") }
|
||||
get signInButton() { return $("[type='submit']") }
|
||||
|
||||
}
|
||||
module.exports = new WalletCreate()
|
||||
@@ -1,78 +1,25 @@
|
||||
class WalletDelegate {
|
||||
|
||||
get header() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span.MuiTypography-root.MuiCardHeader-subheader.MuiTypography-subtitle1.MuiTypography-colorTextSecondary.MuiTypography-displayBlock")
|
||||
}
|
||||
|
||||
get nodeIdentity() {
|
||||
return $("#identity");
|
||||
}
|
||||
|
||||
get accountBalance() {
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(3) > div:nth-child(1) > div > div.MuiCardContent-root > div > div > h6");
|
||||
}
|
||||
|
||||
get amountToDelegate() {
|
||||
return $("#amount");
|
||||
}
|
||||
|
||||
get identityValidation() {
|
||||
return $("#identity-helper-text");
|
||||
}
|
||||
|
||||
get amountToDelegateValidation() {
|
||||
return $("#amount-helper-text");
|
||||
}
|
||||
|
||||
get delegateStakeButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > button > span.MuiButton-label");
|
||||
}
|
||||
|
||||
get mixNodeRadioButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(1) > fieldset > div > label:nth-child(1) > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-8.MuiRadio-root.MuiRadio-colorSecondary.PrivateSwitchBase-checked-9.Mui-checked.MuiIconButton-colorSecondary > span.MuiIconButton-label > input");
|
||||
}
|
||||
|
||||
get gateWayRadioButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(1) > fieldset > div > label:nth-child(2) > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-8.MuiRadio-root.MuiRadio-colorSecondary.MuiIconButton-colorSecondary > span.MuiIconButton-label > input");
|
||||
}
|
||||
|
||||
get transactionFeeAmount() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(2) > div > div.MuiAlert-message");
|
||||
}
|
||||
|
||||
get successfullyDelegate() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div:nth-child(1) > div > div.MuiAlert-message > div");
|
||||
}
|
||||
|
||||
get finishSuccessDelegation() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div:nth-child(2) > button");
|
||||
}
|
||||
get header() { return $("[data-testid='Delegate']") }
|
||||
get nodeIdentity() { return $("#identity") }
|
||||
get amountToDelegate() { return $("#amount") }
|
||||
get identityValidation() { return $("#identity-helper-text") }
|
||||
get amountToDelegateValidation() { return $("#amount-helper-text") }
|
||||
get delegateStakeButton() { return $("[data-testid='delegate-button']") }
|
||||
get mixNodeRadioButton() { return $("[data-testid='mix-node']") }
|
||||
get gateWayRadioButton() { return $("[data-testid='gate-way']") }
|
||||
get successfullyDelegate() { return $("[data-testid='delegate-success']") }
|
||||
get finishButton() { return $("[data-testid='finish-button']") }
|
||||
get transactionFeeAmount() { return $("[data-testid='fee-amount']") }
|
||||
get accountBalance() { return $("[data-testid='account-balance']") }
|
||||
|
||||
//Undelegate
|
||||
|
||||
get unDelegateHeader(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span.MuiTypography-root.MuiCardHeader-subheader.MuiTypography-subtitle1.MuiTypography-colorTextSecondary.MuiTypography-displayBlock");
|
||||
}
|
||||
|
||||
get unNodeIdentity(){
|
||||
return $("#mui-52147");
|
||||
}
|
||||
|
||||
get unDelegateFeeText(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(2) > div > div.MuiAlert-message");
|
||||
}
|
||||
|
||||
get unDelegateGatewayRadioButton(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(1) > fieldset > div > label:nth-child(2) > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-8.MuiRadio-root.MuiRadio-colorSecondary.MuiIconButton-colorSecondary > span.MuiIconButton-label > input");
|
||||
}
|
||||
|
||||
get unMixNodeRadioButton(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(1) > fieldset > div > label:nth-child(1) > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-8.MuiRadio-root.MuiRadio-colorSecondary.MuiIconButton-colorSecondary > span.MuiIconButton-label > input");
|
||||
}
|
||||
|
||||
get unDelegateButton(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > button > span.MuiButton-label");
|
||||
}
|
||||
get unDelegateHeader() { return $("[data-testid='Undelegate']") }
|
||||
get unNodeIdentity() { return $("[name='identity']") }
|
||||
get unDelegateFeeText() { return $("[data-testid='fee-amount']") }
|
||||
get unDelegateGatewayRadioButton() { return $("[data-testid='gate-way']") }
|
||||
get unMixNodeRadioButton() { return $("[data-testid='mix-node']") }
|
||||
get unDelegateButton() { return $("[data-testid='submit-button']") }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +1,16 @@
|
||||
class WalletHome {
|
||||
|
||||
get balanceCheck() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span");
|
||||
}
|
||||
|
||||
get punkBalance() {
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(3) > div:nth-child(1) > div > div.MuiCardContent-root > div > div > h6");
|
||||
}
|
||||
|
||||
get punkAddress() {
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(3) > div:nth-child(2) > div > div.MuiCardContent-root > div > p");
|
||||
}
|
||||
|
||||
get sendButton() {
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > a:nth-child(2) > div.MuiListItemText-root > span");
|
||||
}
|
||||
|
||||
get receiveButton() {
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > a:nth-child(3) > div.MuiListItemText-root > span");
|
||||
}
|
||||
|
||||
get bondButton(){
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > a:nth-child(4) > div.MuiListItemText-root > span");
|
||||
}
|
||||
|
||||
get unBondButton(){
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > a:nth-child(5) > div.MuiListItemText-root > span");
|
||||
}
|
||||
|
||||
get delegateButton(){
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > a:nth-child(6) > div.MuiListItemText-root > span");
|
||||
}
|
||||
|
||||
get unDelegateButton(){
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > a:nth-child(7) > div.MuiListItemText-root > span");
|
||||
}
|
||||
|
||||
get docsButton(){
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > a:nth-child(8) > div.MuiListItemText-root > span");
|
||||
}
|
||||
|
||||
get logOutButton(){
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(4) > div > ul > div > div.MuiListItemText-root > span");
|
||||
}
|
||||
get balanceCheck() { return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span"); }
|
||||
get punkBalance() { return $("") }
|
||||
get punkAddress() { return $("[data-testid='walet-address']") }
|
||||
get balanceButton() { return $("[href='/balance']") }
|
||||
get sendButton() { return $("[href='/send']"); }
|
||||
get receiveButton() { return $("[href='/receive']") }
|
||||
get bondButton() { return $("[href='/bond']") }
|
||||
get unBondButton() { return $("[href='/unbond']") }
|
||||
get delegateButton() { return $("[href='/delegate']") }
|
||||
get unDelegateButton() { return $("[href='/undelegate']") }
|
||||
get logOutButton() { return $("[data-testid='log-out']") }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,36 +1,12 @@
|
||||
class WalletLogin {
|
||||
|
||||
get signInLabel() {
|
||||
return $("#root > div > div:nth-child(2) > div > h4");
|
||||
}
|
||||
|
||||
get mnemonic() {
|
||||
return $("#mnemonic");
|
||||
}
|
||||
|
||||
get signInButton() {
|
||||
return $("#root > div > div:nth-child(2) > div > form > div > div:nth-child(2) > button > span.MuiButton-label");
|
||||
}
|
||||
|
||||
get errorValidation() {
|
||||
return $("#root > div > div:nth-child(2) > div > form > div > div:nth-child(3) > div > div.MuiAlert-message");
|
||||
}
|
||||
|
||||
get accountBalance() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span");
|
||||
}
|
||||
|
||||
get accountBalanceText() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div > div > div.MuiAlert-message");
|
||||
}
|
||||
|
||||
get walletAddress() {
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(3) > div:nth-child(2) > div > div.MuiCardContent-root > div > p");
|
||||
}
|
||||
|
||||
get createNewAccount(){
|
||||
return $("#root > div > div:nth-child(2) > div > form > div > div:nth-child(3) > a");
|
||||
}
|
||||
get signInLabel() {return $("[data-testid='sign-in']")}
|
||||
get mnemonic() { return $("#mnemonic")}
|
||||
get signInButton() {return $("[type='submit']") }
|
||||
get errorValidation() {return $("[class='MuiAlert-message']") }
|
||||
get accountBalance() {return $("[data-test-id='account-balance']")}
|
||||
get accountBalanceText() {return $("[class='MuiAlert-message']")}
|
||||
get walletAddress() {return $("[data-testid='wallet-address']")}
|
||||
|
||||
//login to the application
|
||||
enterMnemonic = async(mnemonic) => {
|
||||
|
||||
@@ -1,38 +1,22 @@
|
||||
class WalletReceive {
|
||||
|
||||
//can these selectors be nicer like the id's?
|
||||
get header() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span");
|
||||
}
|
||||
|
||||
get walletAddress() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(1) > span");
|
||||
}
|
||||
|
||||
get copyButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(1) > button > span.MuiButton-label");
|
||||
}
|
||||
|
||||
get qrCode() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(2) > div > canvas");
|
||||
}
|
||||
|
||||
get information() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiAlert-message");
|
||||
}
|
||||
|
||||
get receiveNymHeader() { return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span") }
|
||||
get receiveNymText() { return $("[data-testid='receive-nym']") }
|
||||
get walletAddress() { return $("[data-testid='client-address']"); }
|
||||
get copyButton() { return $("[data-testid='copy-button']") }
|
||||
get qrCode() { return $("[data-testid='qr-code']") }
|
||||
|
||||
WaitForButtonChangeOnCopy = async () => {
|
||||
await this.copyButton.click();
|
||||
await this.copyButton.click()
|
||||
|
||||
await this.copyButton.waitForDisplayed({ timeout: 1500 });
|
||||
await this.copyButton.waitForDisplayed({ timeout: 1500 })
|
||||
|
||||
await this.copyButton.waitUntil(async function () {
|
||||
return (await this.getText()) === 'COPIED'
|
||||
}, {
|
||||
timeout: 1500,
|
||||
timeoutMsg: 'expected text to be different after 1.5s'
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,75 +1,21 @@
|
||||
class WalletSend {
|
||||
|
||||
|
||||
get fromAddress(){
|
||||
return $("#from");
|
||||
}
|
||||
|
||||
get toAddress(){
|
||||
return $("#to");
|
||||
}
|
||||
|
||||
get amount(){
|
||||
return $("#amount")
|
||||
}
|
||||
|
||||
//can these selectors be nicer like the id's?
|
||||
get nextButton(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(3) > button > span.MuiButton-label");
|
||||
}
|
||||
|
||||
get sendHeader(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardHeader-root > div > span");
|
||||
}
|
||||
|
||||
get transferAmount(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(7) > p:nth-child(2)");
|
||||
}
|
||||
|
||||
get accountBalance(){
|
||||
return $("#root > div > div:nth-child(1) > div:nth-child(3) > div:nth-child(1) > div > div.MuiCardContent-root > div > div > h6");
|
||||
}
|
||||
|
||||
get amountReviewAndSend(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(5) > p:nth-child(2)");
|
||||
}
|
||||
|
||||
get toAddressReviewAndSend(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(3) > p:nth-child(2)");
|
||||
}
|
||||
|
||||
get fromAddressReviewAndSend(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(1) > p:nth-child(2)");
|
||||
}
|
||||
|
||||
get transferFeeAmount(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div > div:nth-child(7) > p:nth-child(2)");
|
||||
}
|
||||
|
||||
get reviewAndSendBackButton(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(3) > button.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-disableElevation > span.MuiButton-label");
|
||||
}
|
||||
|
||||
get sendButton(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(3) > button.MuiButtonBase-root.MuiButton-root.MuiButton-contained.MuiButton-containedPrimary.MuiButton-disableElevation > span.MuiButton-label");
|
||||
}
|
||||
|
||||
get transactionComplete(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div:nth-child(1) > p");
|
||||
}
|
||||
|
||||
get transactionCompleteRecipient(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div.MuiPaper-root.MuiCard-root.MuiPaper-outlined.MuiPaper-rounded > div:nth-child(1) > div:nth-child(2) > p");
|
||||
|
||||
}
|
||||
|
||||
get transactionCompleteAmount(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > div > div.MuiPaper-root.MuiCard-root.MuiPaper-outlined.MuiPaper-rounded > div:nth-child(2) > div:nth-child(2) > p");
|
||||
}
|
||||
|
||||
get finishButton(){
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(3) > button");
|
||||
}
|
||||
get fromAddress() { return $("#from") }
|
||||
get toAddress() { return $("#to") }
|
||||
get amount() { return $("#amount") }
|
||||
get nextButton() { return $("[data-testid='button") }
|
||||
get sendHeader() { return $("[data-testid='Send PUNK']") }
|
||||
get accountBalance() { return $("[data-testid='account-balance']") }
|
||||
get amountReviewAndSend() { return $("[data-testid='Amount']") }
|
||||
get toAddressReviewAndSend() { return $("[data-testid='To']") }
|
||||
get fromAddressReviewAndSend() { return $("[data-testid='From']") }
|
||||
get transferFeeAmount() { return $("[data-testid='Transfer fee']") }
|
||||
get reviewAndSendBackButton() { return $("[data-testid='back-button']") }
|
||||
get sendButton() { return $("[data-testid='button']") }
|
||||
get transactionComplete() { return $("[data-testid='transaction-complete']") }
|
||||
get transactionCompleteRecipient() { return $("[data-testid='to-address']") }
|
||||
get transactionCompleteAmount() { return $("[data-testid='send-amount']") }
|
||||
get finishButton() { return $("[data-testid='button']") }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,12 @@
|
||||
class WallentUndelegate {
|
||||
//todo
|
||||
get transactionFee() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(2) > div > div.MuiAlert-message");
|
||||
}
|
||||
get mixNodeRadioButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(1) > fieldset > div > label:nth-child(1) > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-20.MuiRadio-root.MuiRadio-colorSecondary.PrivateSwitchBase-checked-21.Mui-checked.MuiIconButton-colorSecondary > span.MuiIconButton-label > input");
|
||||
}
|
||||
|
||||
get gatewayRadionButton() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(1) > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-item.MuiGrid-justify-content-xs-space-between.MuiGrid-grid-xs-12 > div:nth-child(1) > fieldset > div > label:nth-child(2) > span.MuiButtonBase-root.MuiIconButton-root.PrivateSwitchBase-root-20.MuiRadio-root.MuiRadio-colorSecondary.MuiIconButton-colorSecondary > span.MuiIconButton-label > input");
|
||||
}
|
||||
get transactionFee() { return $("[data-testid='fee-amount']") }
|
||||
get mixNodeRadioButton() { return $("[value='mixnode']") }
|
||||
get gatewayRadionButton() { return $("[value='gateway']") }
|
||||
get nodeIdentity() { return $("#mui-55011") }
|
||||
get identityHelper() { return $("#identity-helper-text") }
|
||||
get delegateButton() { return $("[data-testid='submit-button']") }
|
||||
|
||||
get nodeIdentity() {
|
||||
return $("#mui-55011");
|
||||
}
|
||||
|
||||
get stakeButtonConfirmation() {
|
||||
return $("#root > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div.MuiCardContent-root > div > div:nth-child(2) > button > span.MuiButton-label");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new WallentUndelegate()
|
||||
@@ -1,4 +1,4 @@
|
||||
const userData = require('../../../common/data/user-data');
|
||||
const userData = require('../../../common/data/user-data.json');
|
||||
const helper = require('../../../common/helpers/helper');
|
||||
const walletLogin = require('../../pages/wallet.login');
|
||||
const textConstants = require('../../../common/constants/text-constants');
|
||||
@@ -24,7 +24,6 @@ describe("bonding and unbonding nodes", () => {
|
||||
const getSphinxKey = await bondPage.sphinxKey.isEnabled();
|
||||
const amountToBond = await bondPage.amountToBond.isEnabled();
|
||||
const hostInput = await bondPage.hostInput.isEnabled();
|
||||
const bondButton = await bondPage.bondButton.isEnabled();
|
||||
const verlocPort = await bondPage.verlocPort.isEnabled();
|
||||
const httpApiPort = await bondPage.httpApiPort.isEnabled();
|
||||
const mixPort = await bondPage.mixPort.isEnabled();
|
||||
@@ -35,7 +34,6 @@ describe("bonding and unbonding nodes", () => {
|
||||
expect(getSphinxKey).toEqual(false);
|
||||
expect(amountToBond).toEqual(false);
|
||||
expect(hostInput).toEqual(false);
|
||||
expect(bondButton).toEqual(false);
|
||||
expect(verlocPort).toEqual(false);
|
||||
expect(httpApiPort).toEqual(false);
|
||||
expect(mixPort).toEqual(false);
|
||||
@@ -46,12 +44,10 @@ describe("bonding and unbonding nodes", () => {
|
||||
await helper.navigateAndClick(walletHomepage.unBondButton);
|
||||
|
||||
const getText = await bondPage.header.getText();
|
||||
const unbondButton = await bondPage.unBondButton.isEnabled();
|
||||
const unbondText = await bondPage.unBondInformation.getText();
|
||||
|
||||
//assert all field are not functional
|
||||
expect(getText).toEqual(textConstants.unbondNodeHeaderText);
|
||||
expect(unbondButton).toEqual(true);
|
||||
expect(unbondText).toEqual(textConstants.unbondMixNodeText);
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const userData = require('../../../common/data/user-data');
|
||||
const userData = require('../../../common/data/user-data.json');
|
||||
const helper = require('../../../common/helpers/helper');
|
||||
const walletLogin = require('../../pages/wallet.login');
|
||||
const textConstants = require('../../../common/constants/text-constants');
|
||||
@@ -8,79 +8,83 @@ const delegatePage = require('../../pages/wallet.delegate');
|
||||
describe("delegate to a mix node or gateway", () => {
|
||||
it("ensure that fields are enabled for existing user", async () => {
|
||||
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic);
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic)
|
||||
|
||||
await walletLogin.enterMnemonic(mnemonic);
|
||||
await walletLogin.enterMnemonic(mnemonic)
|
||||
|
||||
await helper.navigateAndClick(walletHomepage.delegateButton);
|
||||
await helper.navigateAndClick(walletHomepage.delegateButton)
|
||||
|
||||
const getText = await delegatePage.header.getText();
|
||||
const getText = await delegatePage.header.getText()
|
||||
|
||||
expect(getText).toEqual(textConstants.delegateHeaderText);
|
||||
expect(getText).toEqual(textConstants.delegateHeaderText)
|
||||
})
|
||||
|
||||
it("submitting the form without input prompts validation errors", async () => {
|
||||
|
||||
await delegatePage.delegateStakeButton.click();
|
||||
await delegatePage.delegateStakeButton.click()
|
||||
|
||||
const getIdentityValidation = await delegatePage.identityValidation.getText();
|
||||
const getAmountValidation = await delegatePage.amountToDelegateValidation.getText();
|
||||
const getText = await delegatePage.header.getText();
|
||||
const getIdentityValidation = await delegatePage.identityValidation.getText()
|
||||
const getAmountValidation = await delegatePage.amountToDelegateValidation.getText()
|
||||
|
||||
expect(getIdentityValidation).toEqual(textConstants.nodeIdentityValidationText)
|
||||
expect(getAmountValidation).toEqual(textConstants.amountValidationText)
|
||||
|
||||
expect(getText).toEqual(textConstants.delegateHeaderText);
|
||||
expect(getIdentityValidation).toEqual(textConstants.nodeIdentityValidationText);
|
||||
expect(getAmountValidation).toEqual(textConstants.amountValidationText);
|
||||
})
|
||||
|
||||
it("input delegate amount and stake whilst checking account balances", async () => {
|
||||
const balanceText = await delegatePage.accountBalance.getText();
|
||||
it("input delegate amount to a mix node then broadcast the transaction then check account balances", async () => {
|
||||
|
||||
const balanceText = await delegatePage.accountBalance.getText()
|
||||
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText();
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText()
|
||||
|
||||
await delegatePage.nodeIdentity.setValue(userData.identity_key_to_delegate);
|
||||
await delegatePage.nodeIdentity.setValue(userData.identity_key_to_delegate_mix_node)
|
||||
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount);
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount)
|
||||
|
||||
//transfer fee + amount delegation
|
||||
const sumCost = await helper.calculateFees(balanceText, getTransfeeAmount, userData.delegate_amount);
|
||||
const sumCost = await helper.calculateFees(balanceText, getTransfeeAmount, userData.delegate_amount)
|
||||
|
||||
await delegatePage.delegateStakeButton.click();
|
||||
await delegatePage.delegateStakeButton.click()
|
||||
|
||||
await delegatePage.finishSuccessDelegation.waitForClickable({ timeout: 10000 });
|
||||
await delegatePage.successfullyDelegate.waitForClickable({ timeout: 10000 })
|
||||
|
||||
const getConfirmationText = await delegatePage.successfullyDelegate.getText();
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete);
|
||||
const getConfirmationText = await delegatePage.successfullyDelegate.getText()
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete)
|
||||
|
||||
const availablePunk = await delegatePage.accountBalance.getText();
|
||||
const availablePunk = await delegatePage.accountBalance.getText()
|
||||
//expect new account balance - the fee calculation above
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost);
|
||||
|
||||
await delegatePage.finishButton.click()
|
||||
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost)
|
||||
|
||||
})
|
||||
//currently skipping, investigating gateway bonding
|
||||
it.skip("input gateway amount and stake then check account balances", async () => {
|
||||
const balanceText = await delegatePage.accountBalance.getText();
|
||||
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText();
|
||||
it("input amount to stake to a gateway then broadcast the transaction then check account balances", async () => {
|
||||
const balanceText = await delegatePage.accountBalance.getText()
|
||||
|
||||
await delegatePage.gateWayRadioButton.click();
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText()
|
||||
|
||||
await delegatePage.nodeIdentity.setValue(userData.identity_key_to_delegate_gateway);
|
||||
await delegatePage.gateWayRadioButton.click()
|
||||
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount);
|
||||
await delegatePage.nodeIdentity.setValue(userData.identity_key_to_delegate_gateway)
|
||||
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount)
|
||||
|
||||
//transfer fee + amount delegation
|
||||
const sumCost = await helper.calculateFees(balanceText, getTransfeeAmount, userData.delegate_amount);
|
||||
|
||||
await delegatePage.delegateStakeButton.click();
|
||||
const sumCost = await helper.calculateFees(balanceText, getTransfeeAmount, userData.delegate_amount)
|
||||
|
||||
await delegatePage.finishSuccessDelegation.waitForClickable({ timeout: 10000 });
|
||||
await delegatePage.delegateStakeButton.click()
|
||||
|
||||
await delegatePage.successfullyDelegate.waitForClickable({ timeout: 10000 })
|
||||
|
||||
const getConfirmationText = await delegatePage.successfullyDelegate.getText();
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete);
|
||||
const getConfirmationText = await delegatePage.successfullyDelegate.getText()
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete)
|
||||
|
||||
const availablePunk = await delegatePage.accountBalance.getText();
|
||||
const availablePunk = await delegatePage.accountBalance.getText()
|
||||
//expect new account balance - the fee calculation above
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost);
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost)
|
||||
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
@@ -1,48 +1,51 @@
|
||||
const userData = require('../../../common/data/user-data');
|
||||
const userData = require('../../../common/data/user-data.json')
|
||||
const helper = require('../../../common/helpers/helper');
|
||||
const walletLogin = require('../../pages/wallet.login');
|
||||
const homepPage = require('../../pages/wallet.homepage');
|
||||
const textConstants = require('../../../common/constants/text-constants');
|
||||
|
||||
describe("Simple navigational and input tests on the wallet home page", () => {
|
||||
it("should have the sign in header", async () => {
|
||||
describe("wallet splash screen", () => {
|
||||
it("should have the sign in header present", async () => {
|
||||
|
||||
const signInText = await walletLogin.signInLabel.getText();
|
||||
|
||||
expect(signInText).toEqual(textConstants.homePageSignIn);
|
||||
});
|
||||
const signInText = await walletLogin.signInLabel.getText()
|
||||
expect(signInText).toEqual(textConstants.homePageSignIn)
|
||||
|
||||
})
|
||||
|
||||
it("submitting the sign in button with no input throws a validation error", async () => {
|
||||
|
||||
await walletLogin.signInButton.click();
|
||||
await walletLogin.signInButton.click()
|
||||
|
||||
const errorResponseText = await walletLogin.errorValidation.getText();
|
||||
const errorResponseText = await walletLogin.errorValidation.getText()
|
||||
expect(errorResponseText).toEqual(textConstants.homePageErrorMnemonic)
|
||||
})
|
||||
|
||||
expect(errorResponseText).toEqual(textConstants.homePageErrorMnemonic);
|
||||
});
|
||||
//currently the punk_address is not fully displayed on the wallet UI
|
||||
//trim the punk address
|
||||
it("successfully input mnemonic and log in", async () => {
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic)
|
||||
|
||||
//currently the punk_address is not fully displayed on the wallet ui wallet
|
||||
it("successfully input a bip39 mnemonic and log in", async () => {
|
||||
await walletLogin.enterMnemonic(mnemonic)
|
||||
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic);
|
||||
await walletLogin.walletAddress.waitForEnabled({ timeout: 5000 })
|
||||
|
||||
await walletLogin.enterMnemonic(mnemonic);
|
||||
const getWalletAddress = await walletLogin.walletAddress.getText()
|
||||
//currently 35 characters are displayed along with three ...
|
||||
//current hack we can assume this is the correct wallet
|
||||
const walletTruncated = userData.punk_address.substring(0,35)
|
||||
|
||||
const getWalletAddress = await walletLogin.walletAddress.getText();
|
||||
expect(walletTruncated + '...').toContain(getWalletAddress)
|
||||
|
||||
expect(userData.punk_address).toContain(getWalletAddress);
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
//log out to homepage
|
||||
it("successfully log out the application", async () => {
|
||||
|
||||
await helper.scrollIntoView(homepPage.logOutButton);
|
||||
await helper.scrollIntoView(homepPage.logOutButton)
|
||||
|
||||
await homepPage.logOutButton.click();
|
||||
await homepPage.logOutButton.click()
|
||||
|
||||
const isNewAccountPresent = await walletLogin.createNewAccount.getText();
|
||||
await walletLogin.signInLabel.waitForEnabled({ timeout: 1500 })
|
||||
expect(await walletLogin.signInLabel.isDisplayed()).toEqual(true)
|
||||
|
||||
expect(isNewAccountPresent).toEqual(textConstants.createOne);
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
@@ -1,4 +1,4 @@
|
||||
const userData = require('../../../common/data/user-data');
|
||||
const userData = require('../../../common/data/user-data.json');
|
||||
const textConstants = require('../../../common/constants/text-constants');
|
||||
const helper = require('../../../common/helpers/helper');
|
||||
const walletLogin = require('../../pages/wallet.login');
|
||||
@@ -8,24 +8,22 @@ const walletHomepage = require('../../pages/wallet.homepage');
|
||||
describe("provide the relevant information about a user nym wallet address", () => {
|
||||
it("should have the receivers address and a qr code present", async () => {
|
||||
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic);
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic)
|
||||
|
||||
await walletLogin.enterMnemonic(mnemonic);
|
||||
await walletLogin.enterMnemonic(mnemonic)
|
||||
|
||||
await walletHomepage.receiveButton.click();
|
||||
await helper.navigateAndClick(walletHomepage.receiveButton)
|
||||
|
||||
await receive.header.waitForDisplayed({ timeout: 1500 });
|
||||
await receive.receiveNymHeader.waitForDisplayed({ timeout: 1500 })
|
||||
|
||||
await receive.WaitForButtonChangeOnCopy();
|
||||
await receive.WaitForButtonChangeOnCopy()
|
||||
|
||||
//implement qr code scanner here
|
||||
const textHeader = await receive.receiveNymHeader.getText();
|
||||
const getInformationText = await receive.receiveNymText.getText()
|
||||
const getPunkAddress = await receive.walletAddress.getText()
|
||||
|
||||
const textHeader = await receive.header.getText();
|
||||
const getInformationText = await receive.information.getText();
|
||||
const getPunkAddress = await receive.walletAddress.getText();
|
||||
|
||||
expect(getPunkAddress).toEqual(userData.punk_address);
|
||||
expect(getInformationText).toEqual(textConstants.recievePageInformation);
|
||||
expect(textConstants.receivePageHeaderText).toEqual(textHeader);
|
||||
});
|
||||
});
|
||||
expect(getPunkAddress).toEqual(userData.punk_address)
|
||||
expect(getInformationText).toEqual(textConstants.recievePageInformation)
|
||||
expect(textConstants.receivePageHeaderText).toEqual(textHeader)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const userData = require('../../../common/data/user-data');
|
||||
const userData = require('../../../common/data/user-data.json');
|
||||
const helper = require('../../../common/helpers/helper');
|
||||
const textConstants = require('../../../common/constants/text-constants');
|
||||
const walletLogin = require('../../pages/wallet.login');
|
||||
@@ -8,38 +8,38 @@ const walletHomepage = require('../../pages/wallet.homepage');
|
||||
describe("send punk to another a wallet", () => {
|
||||
it("expect send screen to display the data", async () => {
|
||||
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic);
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic)
|
||||
|
||||
await walletLogin.enterMnemonic(mnemonic);
|
||||
await walletLogin.enterMnemonic(mnemonic)
|
||||
|
||||
await walletHomepage.sendButton.click();
|
||||
await helper.navigateAndClick(walletHomepage.sendButton)
|
||||
|
||||
const textHeader = await sendWallet.sendHeader.getText();
|
||||
const textHeader = await sendWallet.sendHeader.getText()
|
||||
|
||||
expect(textHeader).toContain(textConstants.sendPunk);
|
||||
expect(textHeader).toContain(textConstants.sendPunk)
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
//continue sequential flow for test
|
||||
//be wary about production - be wary of funds allocation factor in gas fees
|
||||
it("send funds correctly to another punk address", async () => {
|
||||
|
||||
//already logged in due to the previous test
|
||||
await sendWallet.toAddress.addValue(userData.receiver_address);
|
||||
await sendWallet.toAddress.addValue(userData.receiver_address)
|
||||
|
||||
await sendWallet.amount.addValue(userData.amount_to_send);
|
||||
await sendWallet.amount.addValue(userData.amount_to_send)
|
||||
|
||||
await sendWallet.nextButton.waitForEnabled({ timeout: 3000 });
|
||||
await sendWallet.nextButton.waitForEnabled({ timeout: 3000 })
|
||||
|
||||
await sendWallet.nextButton.click();
|
||||
await sendWallet.nextButton.click()
|
||||
|
||||
await sendWallet.sendButton.click();
|
||||
await sendWallet.sendButton.click()
|
||||
|
||||
await sendWallet.finishButton.waitForClickable({ timeout: 10000 });
|
||||
await sendWallet.finishButton.waitForClickable({ timeout: 10000 })
|
||||
|
||||
await sendWallet.finishButton.click();
|
||||
await sendWallet.finishButton.click()
|
||||
|
||||
//todo implement asserts around account balance at the start vs the end
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -1,34 +1,32 @@
|
||||
const userData = require('../../../common/data/user-data');
|
||||
const userData = require('../../../common/data/user-data.json');
|
||||
const helper = require('../../../common/helpers/helper');
|
||||
const walletLogin = require('../../pages/wallet.login');
|
||||
const walletHomepage = require('../../pages/wallet.homepage');
|
||||
const unDelegatePage = require('../../pages/wallet.delegate');
|
||||
|
||||
describe("un-delegate to a mix node or gateway", () => {
|
||||
describe("un-delegate a mix node or gateway", () => {
|
||||
it("ensure that fields are enabled for existing user", async () => {
|
||||
|
||||
//we are ensuring that the fields are selectable for undelegation
|
||||
//not proceeding to undelegate a node or gateway
|
||||
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic);
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic)
|
||||
|
||||
await walletLogin.enterMnemonic(mnemonic);
|
||||
await walletLogin.enterMnemonic(mnemonic)
|
||||
|
||||
await helper.scrollIntoView(walletHomepage.unDelegateButton);
|
||||
await helper.scrollIntoView(walletHomepage.unDelegateButton)
|
||||
|
||||
await helper.navigateAndClick(walletHomepage.unDelegateButton);
|
||||
await helper.navigateAndClick(walletHomepage.unDelegateButton)
|
||||
|
||||
await unDelegatePage.unDelegateButton.waitForClickable({ timeout: 3000});
|
||||
await unDelegatePage.unDelegateButton.waitForClickable({ timeout: 1500})
|
||||
|
||||
const button = await unDelegatePage.unDelegateButton.isEnabled();
|
||||
expect(button).toEqual(true);
|
||||
await unDelegatePage.unDelegateButton.isEnabled()
|
||||
|
||||
await unDelegatePage.unDelegateGatewayRadioButton.click()
|
||||
|
||||
await unDelegatePage.unDelegateGatewayRadioButton.click();
|
||||
const gateWaySelected = await unDelegatePage.unDelegateGatewayRadioButton.isSelected();
|
||||
await unDelegatePage.unDelegateGatewayRadioButton.isSelected()
|
||||
|
||||
expect(gateWaySelected).toEqual(true);
|
||||
|
||||
const mixNodeRadioButton = await unDelegatePage.unMixNodeRadioButton.isSelected();
|
||||
expect(mixNodeRadioButton).toEqual(false);
|
||||
const mixNodeRadioButton = await unDelegatePage.unMixNodeRadioButton.isSelected()
|
||||
expect(mixNodeRadioButton).toEqual(false)
|
||||
})
|
||||
});
|
||||
})
|
||||
|
||||
@@ -1,26 +1,38 @@
|
||||
const walletLogin = require('../../pages/wallet.login');
|
||||
const walletSignUp = require('../../pages/wallet.create')
|
||||
const textConstants = require('../../../common/constants/text-constants');
|
||||
// const walletLogin = require('../../pages/wallet.login');
|
||||
// const walletSignUp = require('../../pages/wallet.create')
|
||||
// const textConstants = require('../../../common/constants/text-constants');
|
||||
|
||||
const WALLET_SUCCESS = "Please store your mnemonic in a safe place. You'll need it to access your wallet"
|
||||
// describe("non existing wallet holder", () => {
|
||||
// //wallet mnemonic gets pushed here
|
||||
// const DATA = []
|
||||
// it("create a new account and wallet", async () => {
|
||||
|
||||
describe("non existing wallet holder", () => {
|
||||
it("create new account", async () => {
|
||||
// const signInText = await walletLogin.signInLabel.getText();
|
||||
// expect(signInText).toEqual(textConstants.homePageSignIn);
|
||||
|
||||
const signInText = await walletLogin.signInLabel.getText();
|
||||
expect(signInText).toEqual(textConstants.homePageSignIn);
|
||||
// await walletSignUp.createAccount.click();
|
||||
|
||||
await walletLogin.createNewAccount.click();
|
||||
// //wallet generation takes some time - apply wait
|
||||
// await walletSignUp.create.click()
|
||||
|
||||
await walletSignUp.createAccount.click();
|
||||
// await walletSignUp.accountCreatedSuccessfully.waitForEnabled({ timeout: 10000 })
|
||||
|
||||
await walletSignUp.accountCreatedSuccessfully.waitForEnabled({ timeout: 6000 });
|
||||
// const getWalletText = await walletSignUp.punkAddress.getText()
|
||||
// expect(getWalletText.length).toEqual(43)
|
||||
|
||||
const getWalletText = await walletSignUp.punkAddress.getText()
|
||||
expect(getWalletText.length).toEqual(43)
|
||||
// const accountCreated = await walletSignUp.accountCreatedSuccessfully.getText()
|
||||
// expect(accountCreated).toEqual(textConstants.walletSuccess)
|
||||
|
||||
const getMnemonic = await walletSignUp.walletMnemonicCreated.getText()
|
||||
expect(getMnemonic).toEqual(WALLET_SUCCESS)
|
||||
// const getMnemonic = await walletSignUp.walletMnemonicValue.getText()
|
||||
// DATA.push(getMnemonic)
|
||||
// })
|
||||
|
||||
})
|
||||
});
|
||||
// it("navigate back to sign in screen and validate mnemonic works", async () => {
|
||||
|
||||
// await walletSignUp.backToSignIn.click()
|
||||
|
||||
// await walletLogin.enterMnemonic(DATA[0])
|
||||
|
||||
// await walletLogin.walletAddress.isDisplayed()
|
||||
// })
|
||||
// })
|
||||
@@ -1,65 +1,81 @@
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
const { spawn, spawnSync } = require("child_process");
|
||||
const nym_path = "../target/release/tauri-wallet";
|
||||
//insert path to binary
|
||||
const nym_path = "../target/input/executable";
|
||||
|
||||
exports.config = {
|
||||
//run sequentially, as using one default user may cause issues for parallel test runs for now
|
||||
//run sequentially, as using one default user may cause issues for parallel test runs for now
|
||||
specs: [
|
||||
"./tests/specs/existinguser/test.wallet.home.js",
|
||||
"./tests/specs/existinguser/test.wallet.send.js",
|
||||
"./tests/specs/existinguser/test.wallet.receive.js",
|
||||
"./tests/specs/existinguser/test.wallet.bond.js",
|
||||
"./tests/specs/existinguser/test.wallet.delegate.js",
|
||||
"./tests/specs/newuser/test.wallet.create.js"
|
||||
"./tests/specs/newuser/test.wallet.create.js"
|
||||
],
|
||||
|
||||
//run tests by providing --suite {{login}}
|
||||
|
||||
//run tests by providing --suite {{login}}
|
||||
suites: {
|
||||
login: ["./tests/specs/existinguser/test.wallet.home.js"],
|
||||
sendAndReceive: ["./tests/specs/existinguser/test.wallet.send.js",
|
||||
"./tests/specs/existinguser/test.wallet.receive.js"],
|
||||
home: ["./tests/specs/existinguser/test.wallet.home.js"],
|
||||
sendreceive: ["./tests/specs/existinguser/test.wallet.send.js",
|
||||
"./tests/specs/existinguser/test.wallet.receive.js"],
|
||||
bond: ["./tests/specs/existinguser/test.wallet.bond.js"],
|
||||
delegate: ["./tests/specs/existinguser/test.wallet.delegate.js",
|
||||
"./tests/specs/existinguser/test.wallet.undelegate.js"],
|
||||
nonExsistingUser : ["./tests/specs/newuser/test.wallet.create.js"]
|
||||
"./tests/specs/existinguser/test.wallet.undelegate.js"],
|
||||
newuser: ["./tests/specs/newuser/test.wallet.create.js"]
|
||||
},
|
||||
maxInstances: 1,
|
||||
capabilities: [
|
||||
{
|
||||
maxInstances: 1,
|
||||
"tauri:options": {
|
||||
application: nym_path,
|
||||
},
|
||||
maxInstances: 1,
|
||||
capabilities: [
|
||||
{
|
||||
maxInstances: 1,
|
||||
"tauri:options": {
|
||||
application: nym_path,
|
||||
},
|
||||
],
|
||||
// ===================
|
||||
// Test Configurations
|
||||
// ===================
|
||||
// Define all options that are relevant for the WebdriverIO instance here
|
||||
//
|
||||
// Level of logging verbosity: trace | debug | info | warn | error | silent
|
||||
logLevel: 'silent',
|
||||
bail: 0,
|
||||
framework: 'mocha',
|
||||
reporters: ['spec'],
|
||||
mochaOpts: {
|
||||
ui: 'bdd',
|
||||
timeout: 60000
|
||||
},
|
||||
logLevel: 'debug',
|
||||
// this is documentented in the readme - you will need to build the project first
|
||||
// ensure the rust project is built since we expect this binary to exist for the webdriver sessions
|
||||
//onPrepare: () => spawnSync("cargo", ["build", "--release"]),
|
||||
],
|
||||
// ===================
|
||||
// Test Configurations
|
||||
// ===================
|
||||
// Define all options that are relevant for the WebdriverIO instance here
|
||||
// Level of logging verbosity: trace | debug | info | warn | error | silent
|
||||
logLevel: 'debug',
|
||||
bail: 0,
|
||||
framework: 'mocha',
|
||||
reporters: ['spec'],
|
||||
mochaOpts: {
|
||||
ui: 'bdd',
|
||||
timeout: 60000
|
||||
},
|
||||
logLevel: 'silent',
|
||||
|
||||
// ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests
|
||||
beforeSession: () =>
|
||||
(tauriDriver = spawn(
|
||||
path.resolve(os.homedir(), ".cargo", "bin", "tauri-driver"),
|
||||
[],
|
||||
{ stdio: [null, process.stdout, process.stderr] }
|
||||
)),
|
||||
// ===================
|
||||
// Test Reporters
|
||||
// ===================
|
||||
reporters: [['allure', {
|
||||
outputDir: 'allure-results',
|
||||
disableWebdriverStepsReporting: true,
|
||||
disableWebdriverScreenshotsReporting: false,
|
||||
}]],
|
||||
|
||||
// clean up the `tauri-driver` process we spawned at the start of the session
|
||||
afterSession: () => tauriDriver.kill()
|
||||
// this is documentented in the readme - you will need to build the project first
|
||||
// ensure the rust project is built since we expect this binary to exist for the webdriver sessions
|
||||
//onPrepare: () => spawnSync("cargo", ["build", "--release"]),
|
||||
|
||||
// ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests
|
||||
beforeSession: () =>
|
||||
(tauriDriver = spawn(
|
||||
path.resolve(os.homedir(), ".cargo", "bin", "tauri-driver"),
|
||||
[],
|
||||
{ stdio: [null, process.stdout, process.stderr] }
|
||||
)),
|
||||
|
||||
afterTest: function (test, context, { error, result, duration, passed, retries }) {
|
||||
if (error) {
|
||||
browser.takeScreenshot()
|
||||
}
|
||||
},
|
||||
|
||||
// clean up the `tauri-driver` process we spawned at the start of the session
|
||||
afterSession: () => tauriDriver.kill()
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ export default function SendFunds() {
|
||||
variant="contained"
|
||||
color="primary"
|
||||
type="submit"
|
||||
data-testid="button"
|
||||
disabled={checkButtonDisabled()}
|
||||
>
|
||||
{activeStep === 1
|
||||
|
||||
Reference in New Issue
Block a user