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 all commits
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
4 changes: 4 additions & 0 deletions wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const config = {
//
specs: ['./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
58 changes: 58 additions & 0 deletions wdio/features/Confirmations/SendEthEOA.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@androidApp
@confirmations
@regression

Feature: Sending ETH to an EOA
A user should be able to send ETH to another EOA address.

Scenario: Import wallet
seaona marked this conversation as resolved.
Show resolved Hide resolved
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
gantunesr marked this conversation as resolved.
Show resolved Hide resolved

Scenario: Setting up Ganache local network
seaona marked this conversation as resolved.
Show resolved Hide resolved
Given Ganache server is started
And I close the Whats New modal
When 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
gantunesr marked this conversation as resolved.
Show resolved Hide resolved
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
gantunesr marked this conversation as resolved.
Show resolved Hide resolved

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
Then Ganache server is stopped

Examples:
| Address | Amount |
| 0x1FDb169Ef12954F20A15852980e1F0C122BfC1D6 | 1 |
14 changes: 14 additions & 0 deletions wdio/step-definitions/common-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import LoginScreen from '../screen-objects/LoginScreen';
import TermOfUseScreen from '../screen-objects/Modals/TermOfUseScreen';
import WhatsNewModal from '../screen-objects/Modals/WhatsNewModal';

import Ganache from '../../app/util/test/ganache';

const ganacheServer = new Ganache();
const validAccount = Accounts.getValidAccount();

Then(/^the Welcome Screen is displayed$/, async () => {
await WelcomeScreen.waitForScreenToDisplay();
});
Expand Down Expand Up @@ -236,8 +241,17 @@ When(/^the toast is displayed$/, async () => {
await CommonScreen.waitForToastToDisplay();
await CommonScreen.waitForToastToDisappear();
});

Given(/^I close the Whats New modal$/, async () => {
await WhatsNewModal.waitForDisplay();
await WhatsNewModal.tapCloseButton();
await WhatsNewModal.waitForDisappear();
});

Given(/^Ganache server is started$/, async () => {
await ganacheServer.start({ mnemonic: validAccount.seedPhrase });
});

Then(/^Ganache server is stopped$/, async () => {
await ganacheServer.quit();
});