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

fix: add custom and add popular network detox test #11632

Merged
merged 2 commits into from
Oct 4, 2024
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
2 changes: 1 addition & 1 deletion app/components/Views/NetworkSelector/NetworkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ const NetworkSelector = () => {
return (
<Cell
key={`${chainId}-${rpcUrl}`}
testID={`network-cell-${name}`}
testID={NetworkListModalSelectorsIDs.CUSTOM_NETWORK_CELL(name)}
variant={CellVariant.Select}
title={name}
avatarProps={{
Expand Down
3 changes: 2 additions & 1 deletion e2e/pages/modals/NetworkApprovalModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NetworkApprovalModalSelectorsIDs } from '../../selectors/Modals/NetworkApprovalModal.selectors';
import Matchers from '../../utils/Matchers';
import Gestures from '../../utils/Gestures';
import TestHelpers from '../../helpers';

class NetworkApprovalModal {
get container() {
Expand All @@ -20,7 +21,7 @@ class NetworkApprovalModal {
}

async tapApproveButton() {
await Gestures.waitAndTap(this.approvedButton);
await Gestures.tap(this.approvedButton);
}
}

Expand Down
5 changes: 1 addition & 4 deletions e2e/pages/modals/NetworkListModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ class NetworkListModal {
return Matchers.getElementByText(network);
}

// Covers the scenario when selecting a custom network on iOS.
// Network icon would also be part of the network name
const regex = new RegExp('[A-Z0-9]\\s' + network, 'is');
return Matchers.getElementByIDAndLabel(CellModalSelectorsIDs.SELECT, regex);
return Matchers.getElementByID(NetworkListModalSelectorsIDs.CUSTOM_NETWORK_CELL(network));
}

async changeNetworkTo(networkName, custom) {
Expand Down
1 change: 1 addition & 0 deletions e2e/selectors/Modals/NetworkListModal.selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export const NetworkListModalSelectorsIDs = {
OTHER_LIST: 'other-network-name',
ADD_BUTTON: 'add-network-button',
TOOLTIP: 'popular-networks-information-tooltip',
CUSTOM_NETWORK_CELL: (customNetwork) => `network-cell-${customNetwork}`,
};
2 changes: 2 additions & 0 deletions e2e/specs/networks/add-popular-networks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { loginToApp } from '../../viewHelper';
import TabBarComponent from '../../pages/TabBarComponent';
import FixtureBuilder from '../../fixtures/fixture-builder';
import { withFixtures } from '../../fixtures/fixture-helper';
import Assertions from '../../utils/Assertions';

const Arbitrum = 'Arbitrum One';

Expand All @@ -31,6 +32,7 @@ describe(Regression('Add all popular networks'), () => {
await SettingsView.tapNetworks();
await NetworkView.tapAddNetworkButton();
await NetworkView.tapNetworkByName(Arbitrum);
await Assertions.checkIfVisible(NetworkApprovalModal.container);
await NetworkApprovalModal.tapApproveButton();
await NetworkAddedModal.tapCloseButton();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ describe(
await DeleteWalletModal.tapIUnderstandButton();
await DeleteWalletModal.typeDeleteInInputBox();
await DeleteWalletModal.tapDeleteMyWalletButton();
await Assertions.checkIfNotVisible(DeleteWalletModal.container);
await TestHelpers.delay(2000);
await Assertions.checkIfVisible(OnboardingView.container);
if (device.getPlatform() === 'ios') {
await Assertions.checkIfVisible(ToastModal.notificationTitle);
await Assertions.checkIfNotVisible(ToastModal.notificationTitle);
} else {
await TestHelpers.delay(3000);
}
await Assertions.checkIfNotVisible(ToastModal.notificationTitle);
await OnboardingView.tapCreateWallet();

// Create new wallet
Expand Down
Loading