Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[e2e] Send ETH to an EOA using Ganache network on Android #6215

Merged
merged 8 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions wdio.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import generateTestReports from './wdio/utils/generateTestReports';
import Ganache from './app/util/test/ganache';
import Accounts from './wdio/helpers/Accounts';

const { removeSync } = require('fs-extra');
const ganacheServer = new Ganache();
const validAccount = Accounts.getValidAccount();

export const config = {
//
Expand Down Expand Up @@ -28,6 +32,10 @@ export const config = {
//
specs: ['./wdio/features/*.feature', './wdio/features/**/*.feature'],

suites: {
confirmations: ['./wdio/features/Confirmations/*.feature']
},

seaona marked this conversation as resolved.
Show resolved Hide resolved
// Patterns to exclude.
exclude: [
// 'path/to/excluded/files'
Expand Down Expand Up @@ -277,8 +285,11 @@ export const config = {
* @param {String} uri path to feature file
* @param {GherkinDocument.IFeature} feature Cucumber feature object
*/
// beforeFeature: function (uri, feature) {
// },
beforeFeature: async function (uri, feature) {
if(uri.includes('Confirmations')) {
await ganacheServer.start({ mnemonic: validAccount.seedPhrase });
}
},
/**
*
* Runs before a Cucumber Scenario.
Expand Down Expand Up @@ -333,8 +344,11 @@ export const config = {
* @param {String} uri path to feature file
* @param {GherkinDocument.IFeature} feature Cucumber feature object
*/
// afterFeature: function (uri, feature) {
// },
afterFeature: async function (uri, feature) {
if(uri.includes('Confirmations')) {
await ganacheServer.quit();
}
},

/**
* Runs after a WebdriverIO command gets executed
Expand Down
56 changes: 56 additions & 0 deletions wdio/features/Confirmations/SendEth.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
@androidApp
@ChainScenarios
@regression

Feature: Sending ETH to an Externally Owned Account (EOA)
A user should be able to send ETH to another EOA address.

Scenario: Import wallet
Given the app displayed the splash animation
And I have imported my wallet
And I tap No Thanks on the Enable security check screen
And I tap No thanks on the onboarding welcome tutorial

Scenario: Setting up Ganache local network
Given I tap on the burger menu
And I tap on "Settings" in the menu
And In settings I tap on "Networks"
And I tap on the Add Network button
Then "POPULAR" tab is displayed on networks screen
And "CUSTOM NETWORKS" tab is displayed on networks screen

When I tap on the "CUSTOM NETWORKS" tab

When I type "<Network>" into Network name field
And I type "<rpcUrl>" into the RPC url field
And I type "<ChainID>" into the Chain ID field
And I type "<Symbol>" into the Network symbol field

When I tap on the Add button
And I tap on Got it in the network education modal
Then I should see the added network name "<Network>" in the top navigation bar

Examples:
| Network | rpcUrl | ChainID | Symbol |
| Localhost 8545 | http://localhost:8545 | 1337 | ETH |

Scenario Outline: Sending ETH to an EOA from inside MetaMask wallet
When On the Main Wallet view I tap "ETHER"
And On the Main Wallet view I tap "Send"
And I enter address "<Address>" in the sender's input box
When I tap button "Next" on Send To view
Then I proceed to the amount view

When I type amount "<Amount>" into amount input field
And I tap button "Next" on the Amount view
Then I should be taken to the transaction confirmation view
And the token amount <Amount> to be sent is visible

When I tap button "Send" on Confirm Amount view
Then I am taken to the token overview screen
And the transaction is submitted with Transaction Complete! toast appearing


Examples:
| Address | Amount |
| 0x1FDb169Ef12954F20A15852980e1F0C122BfC1D6 | 1 |