getting branch up to date with tauri changes and webriver changes
This commit is contained in:
Generated
+4
-4
@@ -6770,9 +6770,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
|
||||
|
||||
[[package]]
|
||||
name = "ts-rs"
|
||||
version = "3.1.0"
|
||||
version = "5.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "369e48de67506679b3a576b0faf666fa9f9acf2fd00b4c61e28bdb6c8e08ec06"
|
||||
checksum = "f34750e8cbb4d87d09f6d7441921cc6d9435dcc58df53bbaec01f5f9945d4801"
|
||||
dependencies = [
|
||||
"dprint-plugin-typescript",
|
||||
"ts-rs-macros",
|
||||
@@ -6780,9 +6780,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ts-rs-macros"
|
||||
version = "3.1.0"
|
||||
version = "5.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f269e8fd28e26b4cdbd01f81f345aaf666131511e54a735a76a614b5062d0a5a"
|
||||
checksum = "4c78e4905e64bb23c814098885e08778dfed7fd796ea503df29aa3ba5fead009"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"proc-macro2",
|
||||
|
||||
@@ -32,7 +32,7 @@ flate2 = { version = "1.0.20", optional = true }
|
||||
sha2 = { version = "0.9.5", optional = true }
|
||||
itertools = { version = "0.10", optional = true }
|
||||
cosmwasm-std = { git = "https://github.com/jstuczyn/cosmwasm", branch="0.14.1-updatedk256", optional = true }
|
||||
ts-rs = "3.0"
|
||||
ts-rs = {version = "5.1", optional = true}
|
||||
|
||||
[features]
|
||||
nymd-client = ["async-trait", "bip39", "config", "cosmrs", "prost", "flate2", "sha2", "itertools", "cosmwasm-std"]
|
||||
|
||||
@@ -6,9 +6,9 @@ use cosmrs::tx::{Fee, Gas};
|
||||
use cosmrs::Coin;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
use ts_rs::TS;
|
||||
|
||||
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Serialize, Deserialize, TS)]
|
||||
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
|
||||
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Serialize, Deserialize)]
|
||||
pub enum Operation {
|
||||
Upload,
|
||||
Init,
|
||||
|
||||
@@ -14,7 +14,7 @@ cosmwasm-std = { git = "https://github.com/jstuczyn/cosmwasm", branch = "0.14.1-
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_repr = "0.1"
|
||||
schemars = "0.8"
|
||||
ts-rs = { version = "3.0", optional = true }
|
||||
ts-rs = { version = "5.1", optional = true }
|
||||
thiserror = "1.0"
|
||||
network-defaults = { path = "../network-defaults" }
|
||||
fixed = "1.1"
|
||||
@@ -22,4 +22,4 @@ az = "1.1"
|
||||
log = "0.4.14"
|
||||
|
||||
[features]
|
||||
default = ["ts-rs"]
|
||||
default = []
|
||||
|
||||
Generated
+266
-183
File diff suppressed because it is too large
Load Diff
@@ -20,15 +20,14 @@ serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.0.0-beta.8", features = [] }
|
||||
tokio = { version = "1.10", features = ["sync"] }
|
||||
dirs = "3.0"
|
||||
# url = "2.2"
|
||||
dirs = "4.0"
|
||||
bip39 = "1.0"
|
||||
thiserror = "1.0"
|
||||
tendermint-rpc = "0.23.0"
|
||||
ts-rs = "3.0"
|
||||
url = "2.0"
|
||||
rand = "0.6.5"
|
||||
|
||||
|
||||
cosmrs = { version = "0.3", features = ["rpc", "bip32", "cosmwasm"] }
|
||||
cosmwasm-std = { git = "https://github.com/jstuczyn/cosmwasm", branch = "0.14.1-updatedk256" }
|
||||
|
||||
@@ -40,6 +39,17 @@ config = { path = "../../common/config" }
|
||||
coconut-interface = { path = "../../common/coconut-interface" }
|
||||
credentials = { path = "../../common/credentials" }
|
||||
|
||||
[dev-dependencies]
|
||||
ts-rs = "5.1"
|
||||
|
||||
[dev-dependencies.mixnet-contract]
|
||||
path = "../../common/mixnet-contract"
|
||||
features = ["ts-rs"]
|
||||
|
||||
[dev-dependencies.validator-client]
|
||||
path = "../../common/client-libs/validator-client"
|
||||
features = ["ts-rs"]
|
||||
|
||||
[features]
|
||||
default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
||||
@@ -10,12 +10,12 @@ use std::convert::TryFrom;
|
||||
use std::fmt;
|
||||
use std::ops::{Add, Sub};
|
||||
use std::str::FromStr;
|
||||
use ts_rs::TS;
|
||||
use validator_client::nymd::{CosmosCoin, GasPrice};
|
||||
|
||||
use crate::format_err;
|
||||
|
||||
#[derive(TS, Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||
pub enum Denom {
|
||||
Major,
|
||||
Minor,
|
||||
@@ -50,7 +50,8 @@ impl FromStr for Denom {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(TS, Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||
pub struct Coin {
|
||||
amount: String,
|
||||
denom: Denom,
|
||||
|
||||
@@ -7,7 +7,6 @@ use mixnet_contract::{Gateway, MixNode};
|
||||
use std::sync::Arc;
|
||||
use tauri::{Menu, MenuItem};
|
||||
use tokio::sync::RwLock;
|
||||
use ts_rs::export;
|
||||
use validator_client::nymd::fee_helpers::Operation;
|
||||
|
||||
mod coin;
|
||||
@@ -70,16 +69,19 @@ fn main() {
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
||||
export! {
|
||||
MixNode => "../src/types/rust/mixnode.ts",
|
||||
Coin => "../src/types/rust/coin.ts",
|
||||
Balance => "../src/types/rust/balance.ts",
|
||||
Gateway => "../src/types/rust/gateway.ts",
|
||||
TauriTxResult => "../src/types/rust/tauritxresult.ts",
|
||||
TransactionDetails => "../src/types/rust/transactiondetails.ts",
|
||||
Operation => "../src/types/rust/operation.ts",
|
||||
Denom => "../src/types/rust/denom.ts",
|
||||
DelegationResult => "../src/types/rust/delegationresult.ts",
|
||||
Account => "../src/types/rust/account.ts",
|
||||
TauriStateParams => "../src/types/rust/stateparams.ts"
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
ts_rs::export! {
|
||||
mixnet_contract::MixNode => "../src/types/rust/mixnode.ts",
|
||||
crate::Coin => "../src/types/rust/coin.ts",
|
||||
crate::Balance => "../src/types/rust/balance.ts",
|
||||
mixnet_contract::Gateway => "../src/types/rust/gateway.ts",
|
||||
crate::TauriTxResult => "../src/types/rust/tauritxresult.ts",
|
||||
crate::TransactionDetails => "../src/types/rust/transactiondetails.ts",
|
||||
validator_client::nymd::fee_helpers::Operation => "../src/types/rust/operation.ts",
|
||||
crate::Denom => "../src/types/rust/denom.ts",
|
||||
crate::DelegationResult => "../src/types/rust/delegationresult.ts",
|
||||
crate::Account => "../src/types/rust/account.ts",
|
||||
crate::TauriStateParams => "../src/types/rust/stateparams.ts"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ use serde::{Deserialize, Serialize};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
use ts_rs::TS;
|
||||
use validator_client::nymd::{AccountId, NymdClient, SigningNymdClient};
|
||||
|
||||
#[derive(TS, Serialize, Deserialize)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Account {
|
||||
contract_address: String,
|
||||
client_address: String,
|
||||
@@ -19,7 +19,8 @@ pub struct Account {
|
||||
mnemonic: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(TS, Serialize, Deserialize)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Balance {
|
||||
coin: Coin,
|
||||
printable_balance: String,
|
||||
|
||||
@@ -8,9 +8,9 @@ use std::convert::{TryFrom, TryInto};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
use ts_rs::TS;
|
||||
|
||||
#[derive(Serialize, Deserialize, TS)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct TauriStateParams {
|
||||
epoch_length: u32,
|
||||
minimum_mixnode_bond: String,
|
||||
|
||||
@@ -7,9 +7,9 @@ use serde::{Deserialize, Serialize};
|
||||
use std::convert::TryInto;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
use ts_rs::TS;
|
||||
|
||||
#[derive(TS, Serialize, Deserialize)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct DelegationResult {
|
||||
source_address: String,
|
||||
target_address: String,
|
||||
|
||||
@@ -7,10 +7,10 @@ use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use tendermint_rpc::endpoint::broadcast::tx_commit::Response;
|
||||
use tokio::sync::RwLock;
|
||||
use ts_rs::TS;
|
||||
use validator_client::nymd::{AccountId, CosmosCoin};
|
||||
|
||||
#[derive(Deserialize, Serialize, TS)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct TauriTxResult {
|
||||
code: u32,
|
||||
gas_wanted: u64,
|
||||
@@ -19,7 +19,8 @@ pub struct TauriTxResult {
|
||||
details: TransactionDetails,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, TS)]
|
||||
#[cfg_attr(test, derive(ts_rs::TS))]
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct TransactionDetails {
|
||||
from_address: String,
|
||||
to_address: String,
|
||||
|
||||
@@ -2,8 +2,8 @@ import { TransactionDetails } from "./transactiondetails";
|
||||
|
||||
export interface TauriTxResult {
|
||||
code: number;
|
||||
gas_wanted: number;
|
||||
gas_used: number;
|
||||
block_height: number;
|
||||
gas_wanted: bigint;
|
||||
gas_used: bigint;
|
||||
block_height: bigint;
|
||||
details: TransactionDetails;
|
||||
}
|
||||
@@ -5,75 +5,82 @@ SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Nym Wallet Webdriverio testsuite
|
||||
|
||||
A webdriverio test suite implementation using tauri driver
|
||||
A webdriverio test suite implementation using tauri driver
|
||||
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`
|
||||
* `NodeJS >= v16.8.0`
|
||||
* `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.json file`
|
||||
## Installation prerequisites
|
||||
|
||||
- `Yarn`
|
||||
- `NodeJS >= v16.8.0`
|
||||
- `Rust & cargo >= v1.56.1`
|
||||
- `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.json file`
|
||||
|
||||
## Key Information
|
||||
* Please read the instructions on the `nym/tauri-wallet/README.md` in the root of the project on how to build the application
|
||||
* Please ensure you have the relevant Webdriver kits installed on your machine -
|
||||
|
||||
- Please read the instructions on the `nym/tauri-wallet/README.md` in the root of the project on how to build the application
|
||||
- Please ensure you have the relevant Webdriver kits installed on your machine -
|
||||
|
||||
```
|
||||
linux:
|
||||
sudo apt-get install -y webkit2gtk-driver
|
||||
```
|
||||
```
|
||||
windows:
|
||||
sudo apt-get install -y webkit2gtk-driver
|
||||
```
|
||||
|
||||
```
|
||||
windows:
|
||||
download msedgedriver.exe from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
|
||||
```
|
||||
please visit [Tauri Studio](https://tauri.studio/en/docs/usage/guides/webdriver/introduction), this will specify the additional drivers you need
|
||||
* The path to run the application is set in the `wdio.conf.js` which lives in the root directory
|
||||
* Before running the suite you need to build the application and check that the application has
|
||||
built successfully, if so, you will have an executable sitting in the target directory in `tauri-wallet/target/*/nym_wallet` (refer to point 1)
|
||||
* The suite will not be able to detect elements on screen if you select a release build, however you can run tests against a release target
|
||||
|
||||
please visit [Tauri Studio](https://tauri.studio/en/docs/usage/guides/webdriver/introduction), this will specify the additional drivers you need
|
||||
|
||||
- The path to run the application is set in the `wdio.conf.js` which lives in the root directory
|
||||
- Before running the suite you need to build the application and check that the application has
|
||||
built successfully, if so, you will have an executable sitting in the target directory in `tauri-wallet/target/*/nym_wallet` (refer to point 1)
|
||||
- The suite will not be able to detect elements on screen if you select a release build, however you can run tests against a release target
|
||||
|
||||
## Installation & usage
|
||||
* `test excution happens inside /webdriver directory`
|
||||
* `test data needs to be provided inside the user-data.json`
|
||||
* `check the wdio.conf.cjs to see the test execution along with the path location of the binary`
|
||||
|
||||
- `test excution happens inside /webdriver directory`
|
||||
- `test data needs to be provided inside the user-data.json`
|
||||
- `check the wdio.conf.cjs to see the test execution along with the path location of the binary`
|
||||
|
||||
```
|
||||
example:
|
||||
example:
|
||||
//mnemonic is a base64 enconded value, which is your 24 character passphrase, these values are for illustration purposes
|
||||
{
|
||||
"mnemonic" : "dGhpcyBpcyBhIHBhc3NwaHJhc2UK",
|
||||
"punk_address" : "punk1f3dzkhmunma5ze5q952daxca6371989189",
|
||||
"receiver_address" : "punk1p0ce82jxxglpmutvhq4mdwgcwf4avm5n1821982",
|
||||
{
|
||||
"mnemonic" : "dGhpcyBpcyBhIHBhc3NwaHJhc2UK",
|
||||
"punk_address" : "punk1f3dzkhmunma5ze5q952daxca6371989189",
|
||||
"receiver_address" : "punk1p0ce82jxxglpmutvhq4mdwgcwf4avm5n1821982",
|
||||
"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:newuser`
|
||||
|
||||
- `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: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>
|
||||
|
||||
- <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
|
||||
|
||||
## TODO
|
||||
|
||||
*Disclaimer*: Still WIP
|
||||
|
||||
_Disclaimer_: Still WIP
|
||||
|
||||
Implement error handling/ beforeTest() - validating json file exists with data for test execution
|
||||
|
||||
|
||||
Currently this is dev'd against a Linux based OS, not tested against windows yet.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
module.exports = {
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "14"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
targets: {
|
||||
node: "14",
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
module.exports = {
|
||||
//receivePage
|
||||
"recievePageInformation" : "You can receive tokens by providing this address to the sender",
|
||||
"receivePageHeaderText": "Receive Nym",
|
||||
|
||||
//sendPage
|
||||
"sendPunk" : "Send PUNK",
|
||||
//receivePage
|
||||
recievePageInformation:
|
||||
"You can receive tokens by providing this address to the sender",
|
||||
receivePageHeaderText: "Receive Nym",
|
||||
|
||||
//homePage
|
||||
"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.",
|
||||
"bondNodeHeaderText": "Bond a node or gateway",
|
||||
"unbondNodeHeaderText" : "Unbond a mixnode or gateway",
|
||||
"unbondMixNodeText": "Looks like you already have a mixnode bonded.",
|
||||
"unbondMixNode": "UNBOND",
|
||||
//sendPage
|
||||
sendPunk: "Send PUNK",
|
||||
|
||||
//delegatePage // undelegatePage
|
||||
"delegateHeaderText" : "Delegate\nDelegate to mixnode or gateway",
|
||||
"nodeIdentityValidationText" : "identity is a required field",
|
||||
"amountValidationText": "amount is a required field",
|
||||
"undelegateHeaderText" : "Undelegate from a mixnode or gateway",
|
||||
"delegationComplete" : "Delegation complete"
|
||||
}
|
||||
//homePage
|
||||
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.",
|
||||
bondNodeHeaderText: "Bond a node or gateway",
|
||||
unbondNodeHeaderText: "Unbond a mixnode or gateway",
|
||||
unbondMixNodeText: "Looks like you already have a mixnode bonded.",
|
||||
unbondMixNode: "UNBOND",
|
||||
|
||||
//delegatePage // undelegatePage
|
||||
delegateHeaderText: "Delegate\nDelegate to mixnode",
|
||||
nodeIdentityValidationText: "identity is a required field",
|
||||
amountValidationText: "amount is a required field",
|
||||
undelegateHeaderText: "Undelegate from a mixnode or gateway",
|
||||
delegationComplete: "Delegation complete",
|
||||
};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"mnemonic": "value",
|
||||
"punk_address": "",
|
||||
"receiver_address": "",
|
||||
"amount_to_send": "",
|
||||
"identity_key_to_delegate_mix_node": "",
|
||||
"identity_key_to_delegate_gateway" : "",
|
||||
"delegate_amount": ""
|
||||
}
|
||||
"mnemonic": "value",
|
||||
"punk_address": "",
|
||||
"receiver_address": "",
|
||||
"amount_to_send": "",
|
||||
"identity_key_to_delegate_mix_node": "",
|
||||
"identity_key_to_delegate_gateway": "",
|
||||
"delegate_amount": ""
|
||||
}
|
||||
|
||||
@@ -1,45 +1,43 @@
|
||||
class Helpers {
|
||||
//helper to decode mnemonic so plain 24 character passphrase isn't in sight albeit it is presented when ruunning the scripts
|
||||
//maybe a show passphrase toggle button?
|
||||
decodeBase = async (input) => {
|
||||
var m = Buffer.from(input, "base64").toString();
|
||||
return m;
|
||||
};
|
||||
|
||||
//helper to decode mnemonic so plain 24 character passphrase isn't in sight albeit it is presented when ruunning the scripts
|
||||
//maybe a show passphrase toggle button?
|
||||
decodeBase = async (input) => {
|
||||
var m = Buffer.from(input, 'base64').toString()
|
||||
return m
|
||||
navigateAndClick = async (element) => {
|
||||
await element.click();
|
||||
};
|
||||
|
||||
scrollIntoView = async (element) => {
|
||||
await element.scrollIntoView();
|
||||
};
|
||||
|
||||
currentBalance = async (value) => {
|
||||
return parseFloat(value.split(/\s+/)[0].toString()).toFixed(5);
|
||||
};
|
||||
|
||||
//todo need to improve calculation - WIP
|
||||
calculateFees = async (beforeBalance, transactionFee, amount, isSend) => {
|
||||
let fee;
|
||||
|
||||
if (isSend) {
|
||||
//send transaction
|
||||
fee = transactionFee.split(/\s+/)[0];
|
||||
} else {
|
||||
//delegate transaction
|
||||
fee = transactionFee.split(/\s+/)[3];
|
||||
}
|
||||
|
||||
navigateAndClick = async (element) => {
|
||||
await element.click()
|
||||
}
|
||||
const currentBalance = beforeBalance.split(/\s+/)[0];
|
||||
|
||||
scrollIntoView = async (element) => {
|
||||
await element.scrollIntoView()
|
||||
}
|
||||
const castCurrentBalance = parseFloat(currentBalance).toFixed(5);
|
||||
const transCost = +parseFloat(amount) + +parseFloat(fee).toFixed(5);
|
||||
|
||||
|
||||
currentBalance = async (value) => {
|
||||
return parseFloat(value.split(/\s+/)[0].toString()).toFixed(5)
|
||||
}
|
||||
|
||||
//todo need to improve calculation - WIP
|
||||
calculateFees = async (beforeBalance, transactionFee, amount, isSend) => {
|
||||
let fee
|
||||
|
||||
if (isSend) {
|
||||
//send transaction
|
||||
fee = transactionFee.split(/\s+/)[0]
|
||||
} else {
|
||||
//delegate transaction
|
||||
fee = transactionFee.split(/\s+/)[3]
|
||||
}
|
||||
|
||||
const currentBalance = beforeBalance.split(/\s+/)[0]
|
||||
|
||||
const castCurrentBalance = parseFloat(currentBalance).toFixed(5)
|
||||
const transCost = +parseFloat(amount) + +parseFloat(fee).toFixed(5)
|
||||
|
||||
let sum = parseFloat(castCurrentBalance) - parseFloat(transCost)
|
||||
return sum.toFixed(5)
|
||||
}
|
||||
let sum = parseFloat(castCurrentBalance) - parseFloat(transCost);
|
||||
return sum.toFixed(5);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = new Helpers()
|
||||
module.exports = new Helpers();
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"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:newuser": "wdio run wdio.conf.cjs --suite newuser"
|
||||
"test:newuser": "wdio run wdio.conf.cjs --suite newuser",
|
||||
"run:prettier": "prettier --write ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^16.11.0",
|
||||
@@ -20,6 +21,7 @@
|
||||
"devDependencies": {
|
||||
"@wdio/local-runner": "^7.14.1",
|
||||
"@wdio/mocha-framework": "^7.14.1",
|
||||
"@wdio/spec-reporter": "^7.14.1"
|
||||
"@wdio/spec-reporter": "^7.14.1",
|
||||
"prettier": "2.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,48 @@
|
||||
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 selectAdvancedOptions() { return $("[type='checkbox']") }
|
||||
get mixPort() { return $("#mixPort") }
|
||||
get verlocPort() { return $("#verlocPort") }
|
||||
get httpApiPort() { return $("#httpApiPort") }
|
||||
get bondButton() { return $("[data-testid='bond-button']") }
|
||||
get unBondButton() { return $("[data-testid='un-bond']") }
|
||||
get unBond() { return $("[data-testid='bond-noded']") }
|
||||
get unBondWarning() {return $("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 $("[type='checkbox']");
|
||||
}
|
||||
get mixPort() {
|
||||
return $("#mixPort");
|
||||
}
|
||||
get verlocPort() {
|
||||
return $("#verlocPort");
|
||||
}
|
||||
get httpApiPort() {
|
||||
return $("#httpApiPort");
|
||||
}
|
||||
get bondButton() {
|
||||
return $("[data-testid='bond-button']");
|
||||
}
|
||||
get unBondButton() {
|
||||
return $("[data-testid='un-bond']");
|
||||
}
|
||||
get unBond() {
|
||||
return $("[data-testid='bond-noded']");
|
||||
}
|
||||
get unBondWarning() {
|
||||
return $("div.MuiAlert-message");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new WalletBond()
|
||||
module.exports = new WalletBond();
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
class WalletCreate {
|
||||
|
||||
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']") }
|
||||
|
||||
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()
|
||||
module.exports = new WalletCreate();
|
||||
|
||||
@@ -1,26 +1,60 @@
|
||||
class WalletDelegate {
|
||||
|
||||
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']") }
|
||||
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 $("[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']") }
|
||||
|
||||
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']");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new WalletDelegate()
|
||||
module.exports = new WalletDelegate();
|
||||
|
||||
@@ -1,18 +1,42 @@
|
||||
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 $("") }
|
||||
get punkAddress() { return $("[data-testid='wallet-address']") }
|
||||
get accountBalance() { return $("[data-testid='account-balance']") }
|
||||
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']") }
|
||||
|
||||
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='wallet-address']");
|
||||
}
|
||||
get accountBalance() {
|
||||
return $("[data-testid='account-balance']");
|
||||
}
|
||||
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']");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new WalletHome()
|
||||
module.exports = new WalletHome();
|
||||
|
||||
@@ -1,18 +1,31 @@
|
||||
class WalletLogin {
|
||||
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']");
|
||||
}
|
||||
|
||||
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) => {
|
||||
await this.mnemonic.addValue(mnemonic);
|
||||
await this.signInButton.click();
|
||||
await this.accountBalance.isExisting();
|
||||
}
|
||||
//login to the application
|
||||
enterMnemonic = async (mnemonic) => {
|
||||
await this.mnemonic.addValue(mnemonic);
|
||||
await this.signInButton.click();
|
||||
await this.accountBalance.isExisting();
|
||||
};
|
||||
}
|
||||
module.exports = new WalletLogin()
|
||||
module.exports = new WalletLogin();
|
||||
|
||||
@@ -1,24 +1,37 @@
|
||||
class WalletReceive {
|
||||
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']");
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
WaitForButtonChangeOnCopy = async () => {
|
||||
await this.copyButton.click()
|
||||
|
||||
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'
|
||||
})
|
||||
}
|
||||
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",
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = new WalletReceive()
|
||||
module.exports = new WalletReceive();
|
||||
|
||||
@@ -1,22 +1,52 @@
|
||||
class WalletSend {
|
||||
|
||||
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']") }
|
||||
|
||||
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']");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new WalletSend()
|
||||
module.exports = new WalletSend();
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
class WallentUndelegate {
|
||||
|
||||
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 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']");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new WallentUndelegate()
|
||||
module.exports = new WallentUndelegate();
|
||||
|
||||
@@ -1,55 +1,54 @@
|
||||
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')
|
||||
const walletHomepage = require('../../pages/wallet.homepage')
|
||||
const bondPage = require('../../pages/wallet.bond')
|
||||
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");
|
||||
const walletHomepage = require("../../pages/wallet.homepage");
|
||||
const bondPage = require("../../pages/wallet.bond");
|
||||
|
||||
describe("bonding and unbonding nodes", () => {
|
||||
it("should have a node already bonded and validate no input fields are enabled", async () => {
|
||||
it("should have a node already bonded and validate no input fields are enabled", 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.bondButton);
|
||||
|
||||
await helper.navigateAndClick(walletHomepage.bondButton);
|
||||
await helper.scrollIntoView(bondPage.selectAdvancedOptions);
|
||||
|
||||
await helper.scrollIntoView(bondPage.selectAdvancedOptions);
|
||||
await bondPage.selectAdvancedOptions.click();
|
||||
|
||||
await bondPage.selectAdvancedOptions.click();
|
||||
//as bond node is mixed expect all the fields to be disabled
|
||||
const getText = await bondPage.header.getText();
|
||||
const getIdentity = await bondPage.identityKey.isEnabled();
|
||||
const getSphinxKey = await bondPage.sphinxKey.isEnabled();
|
||||
const amountToBond = await bondPage.amountToBond.isEnabled();
|
||||
const hostInput = await bondPage.hostInput.isEnabled();
|
||||
const verlocPort = await bondPage.verlocPort.isEnabled();
|
||||
const httpApiPort = await bondPage.httpApiPort.isEnabled();
|
||||
const mixPort = await bondPage.mixPort.isEnabled();
|
||||
|
||||
//as bond node is mixed expect all the fields to be disabled
|
||||
const getText = await bondPage.header.getText()
|
||||
const getIdentity = await bondPage.identityKey.isEnabled()
|
||||
const getSphinxKey = await bondPage.sphinxKey.isEnabled()
|
||||
const amountToBond = await bondPage.amountToBond.isEnabled()
|
||||
const hostInput = await bondPage.hostInput.isEnabled()
|
||||
const verlocPort = await bondPage.verlocPort.isEnabled()
|
||||
const httpApiPort = await bondPage.httpApiPort.isEnabled()
|
||||
const mixPort = await bondPage.mixPort.isEnabled()
|
||||
//assert all field are not functional
|
||||
expect(getText).toEqual(textConstants.bondNodeHeaderText);
|
||||
expect(getIdentity).toEqual(false);
|
||||
expect(getSphinxKey).toEqual(false);
|
||||
expect(amountToBond).toEqual(false);
|
||||
expect(hostInput).toEqual(false);
|
||||
expect(verlocPort).toEqual(false);
|
||||
expect(httpApiPort).toEqual(false);
|
||||
expect(mixPort).toEqual(false);
|
||||
});
|
||||
|
||||
//assert all field are not functional
|
||||
expect(getText).toEqual(textConstants.bondNodeHeaderText)
|
||||
expect(getIdentity).toEqual(false)
|
||||
expect(getSphinxKey).toEqual(false)
|
||||
expect(amountToBond).toEqual(false)
|
||||
expect(hostInput).toEqual(false)
|
||||
expect(verlocPort).toEqual(false)
|
||||
expect(httpApiPort).toEqual(false)
|
||||
expect(mixPort).toEqual(false)
|
||||
})
|
||||
it("unbond mix monde screen should be present with the option to unbond", async () => {
|
||||
//we do not want to unbond our node, check that elements are selectable
|
||||
await helper.scrollIntoView(walletHomepage.unBondButton);
|
||||
await helper.navigateAndClick(walletHomepage.unBondButton);
|
||||
|
||||
it("unbond mix monde screen should be present with the option to unbond", async () => {
|
||||
//we do not want to unbond our node, check that elements are selectable
|
||||
await helper.scrollIntoView(walletHomepage.unBondButton)
|
||||
await helper.navigateAndClick(walletHomepage.unBondButton)
|
||||
const getText = await bondPage.header.getText();
|
||||
const unbondText = await bondPage.unBondWarning.getText();
|
||||
|
||||
const getText = await bondPage.header.getText()
|
||||
const unbondText = await bondPage.unBondWarning.getText()
|
||||
|
||||
await bondPage.unBondButton.isClickable()
|
||||
//assert all field are not functional
|
||||
expect(getText).toEqual(textConstants.unbondNodeHeaderText)
|
||||
expect(unbondText).toEqual(textConstants.unbondMixNodeText)
|
||||
})
|
||||
})
|
||||
await bondPage.unBondButton.isClickable();
|
||||
//assert all field are not functional
|
||||
expect(getText).toEqual(textConstants.unbondNodeHeaderText);
|
||||
expect(unbondText).toEqual(textConstants.unbondMixNodeText);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,90 +1,108 @@
|
||||
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')
|
||||
const walletHomepage = require('../../pages/wallet.homepage')
|
||||
const delegatePage = require('../../pages/wallet.delegate')
|
||||
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");
|
||||
const walletHomepage = require("../../pages/wallet.homepage");
|
||||
const delegatePage = require("../../pages/wallet.delegate");
|
||||
|
||||
describe("delegate to a mix node or gateway", () => {
|
||||
it("ensure that fields are enabled for existing user", async () => {
|
||||
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();
|
||||
|
||||
it("submitting the form without input prompts validation errors", async () => {
|
||||
const getIdentityValidation =
|
||||
await delegatePage.identityValidation.getText();
|
||||
const getAmountValidation =
|
||||
await delegatePage.amountToDelegateValidation.getText();
|
||||
|
||||
await delegatePage.delegateStakeButton.click()
|
||||
expect(getIdentityValidation).toEqual(
|
||||
textConstants.nodeIdentityValidationText
|
||||
);
|
||||
expect(getAmountValidation).toEqual(textConstants.amountValidationText);
|
||||
});
|
||||
|
||||
const getIdentityValidation = await delegatePage.identityValidation.getText()
|
||||
const getAmountValidation = await delegatePage.amountToDelegateValidation.getText()
|
||||
it("input delegate amount to a mix node then broadcast the transaction then check account balances", async () => {
|
||||
const balanceText = await delegatePage.accountBalance.getText();
|
||||
|
||||
expect(getIdentityValidation).toEqual(textConstants.nodeIdentityValidationText)
|
||||
expect(getAmountValidation).toEqual(textConstants.amountValidationText)
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText();
|
||||
|
||||
})
|
||||
await delegatePage.nodeIdentity.setValue(
|
||||
userData.identity_key_to_delegate_mix_node
|
||||
);
|
||||
|
||||
it("input delegate amount to a mix node then broadcast the transaction then check account balances", async () => {
|
||||
|
||||
const balanceText = await delegatePage.accountBalance.getText()
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount);
|
||||
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText()
|
||||
//transfer fee + amount delegation
|
||||
const sumCost = await helper.calculateFees(
|
||||
balanceText,
|
||||
getTransfeeAmount,
|
||||
userData.delegate_amount,
|
||||
false
|
||||
);
|
||||
|
||||
await delegatePage.nodeIdentity.setValue(userData.identity_key_to_delegate_mix_node)
|
||||
await delegatePage.delegateStakeButton.click();
|
||||
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount)
|
||||
await delegatePage.successfullyDelegate.waitForClickable({
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
//transfer fee + amount delegation
|
||||
const sumCost = await helper.calculateFees(balanceText, getTransfeeAmount, userData.delegate_amount, false)
|
||||
const getConfirmationText =
|
||||
await delegatePage.successfullyDelegate.getText();
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete);
|
||||
|
||||
await delegatePage.delegateStakeButton.click()
|
||||
const availablePunk = await delegatePage.accountBalance.getText();
|
||||
//expect new account balance - the fee calculation above
|
||||
|
||||
await delegatePage.successfullyDelegate.waitForClickable({ timeout: 10000 })
|
||||
await delegatePage.finishButton.click();
|
||||
|
||||
const getConfirmationText = await delegatePage.successfullyDelegate.getText()
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete)
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost);
|
||||
});
|
||||
|
||||
const availablePunk = await delegatePage.accountBalance.getText()
|
||||
//expect new account balance - the fee calculation above
|
||||
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.finishButton.click()
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText();
|
||||
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost)
|
||||
|
||||
})
|
||||
await delegatePage.gateWayRadioButton.click();
|
||||
|
||||
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.nodeIdentity.setValue(
|
||||
userData.identity_key_to_delegate_gateway
|
||||
);
|
||||
|
||||
const getTransfeeAmount = await delegatePage.transactionFeeAmount.getText()
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount);
|
||||
|
||||
await delegatePage.gateWayRadioButton.click()
|
||||
//transfer fee + amount delegation
|
||||
|
||||
await delegatePage.nodeIdentity.setValue(userData.identity_key_to_delegate_gateway)
|
||||
const sumCost = await helper.calculateFees(
|
||||
balanceText,
|
||||
getTransfeeAmount,
|
||||
userData.delegate_amount,
|
||||
false
|
||||
);
|
||||
|
||||
await delegatePage.amountToDelegate.setValue(userData.delegate_amount)
|
||||
await delegatePage.delegateStakeButton.click();
|
||||
|
||||
//transfer fee + amount delegation
|
||||
await delegatePage.successfullyDelegate.waitForClickable({
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
const sumCost = await helper.calculateFees(balanceText, getTransfeeAmount, userData.delegate_amount, false)
|
||||
const getConfirmationText =
|
||||
await delegatePage.successfullyDelegate.getText();
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete);
|
||||
|
||||
await delegatePage.delegateStakeButton.click()
|
||||
|
||||
await delegatePage.successfullyDelegate.waitForClickable({ timeout: 10000 })
|
||||
|
||||
const getConfirmationText = await delegatePage.successfullyDelegate.getText()
|
||||
expect(getConfirmationText).toContain(textConstants.delegationComplete)
|
||||
|
||||
const availablePunk = await delegatePage.accountBalance.getText()
|
||||
//expect new account balance - the fee calculation above
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost)
|
||||
|
||||
})
|
||||
})
|
||||
const availablePunk = await delegatePage.accountBalance.getText();
|
||||
//expect new account balance - the fee calculation above
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,51 +1,45 @@
|
||||
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')
|
||||
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("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()
|
||||
expect(errorResponseText).toEqual(textConstants.homePageErrorMnemonic)
|
||||
})
|
||||
const errorResponseText = await walletLogin.errorValidation.getText();
|
||||
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)
|
||||
const mnemonic = await helper.decodeBase(userData.mnemonic);
|
||||
|
||||
await walletLogin.enterMnemonic(mnemonic)
|
||||
await walletLogin.enterMnemonic(mnemonic);
|
||||
|
||||
await walletLogin.walletAddress.waitForEnabled({ timeout: 5000 })
|
||||
await walletLogin.walletAddress.waitForEnabled({ timeout: 5000 });
|
||||
|
||||
const getWalletAddress = await walletLogin.walletAddress.getText()
|
||||
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 walletTruncated = userData.punk_address.substring(0, 35);
|
||||
|
||||
expect(walletTruncated + '...').toContain(getWalletAddress)
|
||||
|
||||
})
|
||||
expect(walletTruncated + "...").toContain(getWalletAddress);
|
||||
});
|
||||
|
||||
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()
|
||||
|
||||
await walletLogin.signInLabel.waitForEnabled({ timeout: 1500 })
|
||||
expect(await walletLogin.signInLabel.isDisplayed()).toEqual(true)
|
||||
|
||||
})
|
||||
})
|
||||
await walletLogin.signInLabel.waitForEnabled({ timeout: 1500 });
|
||||
expect(await walletLogin.signInLabel.isDisplayed()).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
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')
|
||||
const receive = require('../../pages/wallet.receive')
|
||||
const walletHomepage = require('../../pages/wallet.homepage')
|
||||
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");
|
||||
const receive = require("../../pages/wallet.receive");
|
||||
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 () => {
|
||||
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 helper.navigateAndClick(walletHomepage.receiveButton);
|
||||
|
||||
await helper.navigateAndClick(walletHomepage.receiveButton)
|
||||
await receive.receiveNymHeader.waitForDisplayed({ timeout: 1500 });
|
||||
|
||||
await receive.receiveNymHeader.waitForDisplayed({ timeout: 1500 })
|
||||
await receive.WaitForButtonChangeOnCopy();
|
||||
|
||||
await receive.WaitForButtonChangeOnCopy()
|
||||
const textHeader = await receive.receiveNymHeader.getText();
|
||||
const getInformationText = await receive.receiveNymText.getText();
|
||||
const getPunkAddress = await receive.walletAddress.getText();
|
||||
|
||||
const textHeader = await receive.receiveNymHeader.getText();
|
||||
const getInformationText = await receive.receiveNymText.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,55 +1,55 @@
|
||||
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')
|
||||
const sendWallet = require('../../pages/wallet.send')
|
||||
const walletHomepage = require('../../pages/wallet.homepage')
|
||||
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");
|
||||
const sendWallet = require("../../pages/wallet.send");
|
||||
const walletHomepage = require("../../pages/wallet.homepage");
|
||||
|
||||
describe("send punk to another a wallet", () => {
|
||||
it("expect send screen to display the data", async () => {
|
||||
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 helper.navigateAndClick(walletHomepage.sendButton);
|
||||
|
||||
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)
|
||||
it("send funds correctly to another punk address", async () => {
|
||||
//already logged in due to the previous test
|
||||
const getCurrentBalance = await walletHomepage.accountBalance.getText();
|
||||
|
||||
})
|
||||
await sendWallet.toAddress.addValue(userData.receiver_address);
|
||||
|
||||
it("send funds correctly to another punk address", async () => {
|
||||
await sendWallet.amount.addValue(userData.amount_to_send);
|
||||
|
||||
//already logged in due to the previous test
|
||||
const getCurrentBalance = await walletHomepage.accountBalance.getText()
|
||||
await sendWallet.nextButton.waitForEnabled({ timeout: 3000 });
|
||||
|
||||
await sendWallet.toAddress.addValue(userData.receiver_address)
|
||||
await sendWallet.nextButton.click();
|
||||
|
||||
await sendWallet.amount.addValue(userData.amount_to_send)
|
||||
const transFee = await sendWallet.transferFeeAmount.getText();
|
||||
|
||||
await sendWallet.nextButton.waitForEnabled({ timeout: 3000 })
|
||||
await sendWallet.sendButton.click();
|
||||
|
||||
await sendWallet.nextButton.click()
|
||||
await sendWallet.finishButton.waitForClickable({ timeout: 10000 });
|
||||
|
||||
const transFee = await sendWallet.transferFeeAmount.getText()
|
||||
let sumCost = await helper.calculateFees(
|
||||
getCurrentBalance,
|
||||
transFee,
|
||||
userData.amount_to_send,
|
||||
true
|
||||
);
|
||||
|
||||
await sendWallet.sendButton.click()
|
||||
await walletHomepage.accountBalance.isDisplayed();
|
||||
|
||||
await sendWallet.finishButton.waitForClickable({ timeout: 10000 })
|
||||
const availablePunk = await walletHomepage.accountBalance.getText();
|
||||
|
||||
let sumCost = await helper.calculateFees(getCurrentBalance, transFee, userData.amount_to_send, true)
|
||||
|
||||
await walletHomepage.accountBalance.isDisplayed()
|
||||
|
||||
const availablePunk = await walletHomepage.accountBalance.getText()
|
||||
|
||||
await sendWallet.finishButton.click()
|
||||
|
||||
//expect new account balance - the fee calculation above
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost)
|
||||
|
||||
})
|
||||
})
|
||||
await sendWallet.finishButton.click();
|
||||
|
||||
//expect new account balance - the fee calculation above
|
||||
expect(await helper.currentBalance(availablePunk)).toEqual(sumCost);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
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')
|
||||
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 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
|
||||
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: 1500})
|
||||
await unDelegatePage.unDelegateButton.waitForClickable({ timeout: 1500 });
|
||||
|
||||
await unDelegatePage.unDelegateButton.isEnabled()
|
||||
|
||||
await unDelegatePage.unDelegateGatewayRadioButton.click()
|
||||
await unDelegatePage.unDelegateButton.isEnabled();
|
||||
|
||||
await unDelegatePage.unDelegateGatewayRadioButton.isSelected()
|
||||
|
||||
const mixNodeRadioButton = await unDelegatePage.unMixNodeRadioButton.isSelected()
|
||||
expect(mixNodeRadioButton).toEqual(false)
|
||||
})
|
||||
})
|
||||
await unDelegatePage.unDelegateGatewayRadioButton.click();
|
||||
|
||||
await unDelegatePage.unDelegateGatewayRadioButton.isSelected();
|
||||
|
||||
const mixNodeRadioButton =
|
||||
await unDelegatePage.unMixNodeRadioButton.isSelected();
|
||||
expect(mixNodeRadioButton).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,38 +1,39 @@
|
||||
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");
|
||||
|
||||
describe("non existing wallet holder", () => {
|
||||
//wallet mnemonic gets pushed here
|
||||
const DATA = []
|
||||
it("create a new account and wallet", async () => {
|
||||
//wallet mnemonic gets pushed here
|
||||
const DATA = [];
|
||||
it("create a new account and wallet", 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 walletSignUp.createAccount.click();
|
||||
//wallet generation takes some time - apply wait
|
||||
await walletSignUp.create.click();
|
||||
|
||||
//wallet generation takes some time - apply wait
|
||||
await walletSignUp.create.click()
|
||||
await walletSignUp.accountCreatedSuccessfully.waitForEnabled({
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
await walletSignUp.accountCreatedSuccessfully.waitForEnabled({ timeout: 10000 })
|
||||
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 accountCreated = await walletSignUp.accountCreatedSuccessfully.getText()
|
||||
expect(accountCreated).toEqual(textConstants.walletSuccess)
|
||||
const getMnemonic = await walletSignUp.walletMnemonicValue.getText();
|
||||
DATA.push(getMnemonic);
|
||||
});
|
||||
|
||||
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();
|
||||
|
||||
it("navigate back to sign in screen and validate mnemonic works", async () => {
|
||||
await walletLogin.enterMnemonic(DATA[0]);
|
||||
|
||||
await walletSignUp.backToSignIn.click()
|
||||
|
||||
await walletLogin.enterMnemonic(DATA[0])
|
||||
|
||||
await walletLogin.walletAddress.isDisplayed()
|
||||
})
|
||||
})
|
||||
await walletLogin.walletAddress.isDisplayed();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ const os = require("os");
|
||||
const path = require("path");
|
||||
const { spawn, spawnSync } = require("child_process");
|
||||
//insert path to binary
|
||||
const nym_path = "../target/release/nym_wallet";
|
||||
const nym_path = "../target/release/nym-wallet";
|
||||
|
||||
exports.config = {
|
||||
//run sequentially, as using one default user may cause issues for parallel test runs for now
|
||||
@@ -12,18 +12,22 @@ exports.config = {
|
||||
"./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: {
|
||||
home: ["./tests/specs/existinguser/test.wallet.home.js"],
|
||||
sendreceive: ["./tests/specs/existinguser/test.wallet.send.js",
|
||||
"./tests/specs/existinguser/test.wallet.receive.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"],
|
||||
newuser: ["./tests/specs/newuser/test.wallet.create.js"]
|
||||
delegate: [
|
||||
"./tests/specs/existinguser/test.wallet.delegate.js",
|
||||
"./tests/specs/existinguser/test.wallet.undelegate.js",
|
||||
],
|
||||
newuser: ["./tests/specs/newuser/test.wallet.create.js"],
|
||||
},
|
||||
maxInstances: 1,
|
||||
capabilities: [
|
||||
@@ -40,22 +44,27 @@ exports.config = {
|
||||
// Define all options that are relevant for the WebdriverIO instance here
|
||||
// Level of logging verbosity: trace | debug | info | warn | error | silent
|
||||
bail: 0,
|
||||
framework: 'mocha',
|
||||
reporters: ['spec'],
|
||||
framework: "mocha",
|
||||
reporters: ["spec"],
|
||||
mochaOpts: {
|
||||
ui: 'bdd',
|
||||
timeout: 60000
|
||||
ui: "bdd",
|
||||
timeout: 60000,
|
||||
},
|
||||
logLevel: 'silent',
|
||||
logLevel: "silent",
|
||||
|
||||
// ===================
|
||||
// Test Reporters
|
||||
// ===================
|
||||
reporters: [['allure', {
|
||||
outputDir: 'allure-results',
|
||||
disableWebdriverStepsReporting: true,
|
||||
disableWebdriverScreenshotsReporting: true,
|
||||
}]],
|
||||
reporters: [
|
||||
[
|
||||
"allure",
|
||||
{
|
||||
outputDir: "allure-results",
|
||||
disableWebdriverStepsReporting: true,
|
||||
disableWebdriverScreenshotsReporting: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
// 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
|
||||
@@ -63,18 +72,22 @@ exports.config = {
|
||||
|
||||
// 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] }
|
||||
)),
|
||||
(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 }) {
|
||||
afterTest: function (
|
||||
test,
|
||||
context,
|
||||
{ error, result, duration, passed, retries }
|
||||
) {
|
||||
if (error) {
|
||||
browser.takeScreenshot()
|
||||
browser.takeScreenshot();
|
||||
}
|
||||
},
|
||||
|
||||
// clean up the `tauri-driver` process we spawned at the start of the session
|
||||
afterSession: () => tauriDriver.kill()
|
||||
}
|
||||
afterSession: () => tauriDriver.kill(),
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ packet_delivery_timeout = '{{ network_monitor.packet_delivery_timeout }}'
|
||||
# Path to directory containing public/private keys used for bandwidth token purchase.
|
||||
# Those are saved in case of emergency, to be able to reclaim bandwidth tokens.
|
||||
# The public key is the name of the file, while the private key is the content.
|
||||
backup_bandwidth_token_keys_dir = '{{ client.backup_bandwidth_token_keys_dir }}'
|
||||
backup_bandwidth_token_keys_dir = '{{ network_monitor.backup_bandwidth_token_keys_dir }}'
|
||||
|
||||
# Ethereum private key.
|
||||
eth_private_key = '{{ network_monitor.eth_private_key }}'
|
||||
|
||||
Reference in New Issue
Block a user