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

feat: Migrate wdio 'SendEthMultisig' test to Detox #6934

Merged
merged 5 commits into from
Aug 2, 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
5 changes: 5 additions & 0 deletions e2e/pages/TabBarComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
TAB_BAR_BROWSER_BUTTON,
TAB_BAR_SETTING_BUTTON,
TAB_BAR_WALLET_BUTTON,
TAB_BAR_ACTIVITY_BUTTON,
} from '../../wdio/screen-objects/testIDs/Components/TabBar.testIds';

export default class TabBarComponent {
Expand All @@ -25,4 +26,8 @@ export default class TabBarComponent {
static async tapSettings() {
await TestHelpers.waitAndTap(TAB_BAR_SETTING_BUTTON);
}

static async tapActivity() {
await TestHelpers.waitAndTap(TAB_BAR_ACTIVITY_BUTTON);
}
}
60 changes: 60 additions & 0 deletions e2e/specs/confirmations/send-eth-multisig.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
'use strict';

import { Regression } from '../../tags';
import TestHelpers from '../../helpers';

import AmountView from '../../pages/AmountView';
import SendView from '../../pages/SendView';
import TransactionConfirmationView from '../../pages/TransactionConfirmView';
import {
importWalletWithRecoveryPhrase,
addLocalhostNetwork,
} from '../../viewHelper';
import TabBarComponent from '../../pages/TabBarComponent';
import WalletActionsModal from '../../pages/modals/WalletActionsModal';
import Accounts from '../../../wdio/helpers/Accounts';
import Ganache from '../../../app/util/test/ganache';
import root from '../../../locales/languages/en.json';

const validAccount = Accounts.getValidAccount();
const MULTISIG_ADDRESS = '0x0C1DD822d1Ddf78b0b702df7BF9fD0991D6255A1';
const AMOUNT_TO_SEND = '0.12345';
const TOKEN_NAME = root.unit.eth;

describe(Regression('Send tests'), () => {
let ganacheServer;
beforeAll(async () => {
jest.setTimeout(2500000);
if (device.getPlatform() === 'android') {
await device.reverseTcpPort('8081'); // because on android we need to expose the localhost ports to run ganache
await device.reverseTcpPort('8545');
}
ganacheServer = new Ganache();
await ganacheServer.start({ mnemonic: validAccount.seedPhrase });
});

afterAll(async () => {
await ganacheServer.quit();
});

it('Send ETH to a Multisig address from inside MetaMask wallet', async () => {
await importWalletWithRecoveryPhrase();
await addLocalhostNetwork();

await TabBarComponent.tapActions();
await WalletActionsModal.tapSendButton();

await SendView.inputAddress(MULTISIG_ADDRESS);
await SendView.tapNextButton();

await AmountView.typeInTransactionAmount(AMOUNT_TO_SEND);
await AmountView.tapNextButton();

await TransactionConfirmationView.tapConfirmButton();
await TabBarComponent.tapActivity();

await TestHelpers.checkIfElementByTextIsVisible(
AMOUNT_TO_SEND + ' ' + TOKEN_NAME,
);
});
});
25 changes: 0 additions & 25 deletions wdio/features/Confirmations/SendEthMultisig.feature

This file was deleted.

Loading