diff --git a/bitrise.yml b/bitrise.yml index f02e4b3e711..e46fa35dea7 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -160,6 +160,7 @@ stages: - run_tag_smoke_assets_android: {} - run_tag_smoke_confirmations_ios: {} - run_tag_smoke_confirmations_android: {} + - run_tag_smoke_ramps_android: {} # - run_tag_smoke_swaps_ios: {} # - run_tag_smoke_swaps_android: {} - run_tag_smoke_core_ios: {} @@ -182,6 +183,7 @@ stages: - run_tag_smoke_confirmations_android: {} - run_tag_smoke_accounts_ios: {} - run_tag_smoke_accounts_android: {} + - run_tag_smoke_ramps_android: {} # - run_tag_smoke_identity_ios: {} # - run_tag_smoke_identity_android: {} # - run_tag_smoke_assets_ios: {} @@ -699,6 +701,16 @@ workflows: - TEST_SUITE_TAG: '.*SmokeMultiChainPermissions.*' after_run: - android_e2e_test + run_tag_smoke_ramps_android: + meta: + bitrise.io: + stack: linux-docker-android-22.04 + machine_type_id: elite-xl + envs: + - TEST_SUITE_FOLDER: './e2e/specs/ramps/*' + - TEST_SUITE_TAG: '.*SmokeRamps.*' + after_run: + - android_e2e_test android_e2e_build: before_run: - code_setup diff --git a/e2e/pages/Network/NetworkAddedBottomSheet.js b/e2e/pages/Network/NetworkAddedBottomSheet.js index 0bb721b3ccc..ca841c6fb2d 100644 --- a/e2e/pages/Network/NetworkAddedBottomSheet.js +++ b/e2e/pages/Network/NetworkAddedBottomSheet.js @@ -13,23 +13,15 @@ class NetworkAddedBottomSheet { } get switchNetworkButton() { - return device.getPlatform() === 'android' - ? Matchers.getElementByLabel( - NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON, - ) - : Matchers.getElementByID( - NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON, - ); + return Matchers.getElementByID( + NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON, + ); } get closeNetworkButton() { - return device.getPlatform() === 'android' - ? Matchers.getElementByLabel( - NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON, - ) - : Matchers.getElementByID( - NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON, - ); + return Matchers.getElementByID( + NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON, + ); } async tapSwitchToNetwork() { diff --git a/e2e/resources/networks.e2e.js b/e2e/resources/networks.e2e.js index 1cd7b4eb927..8480ea55e74 100644 --- a/e2e/resources/networks.e2e.js +++ b/e2e/resources/networks.e2e.js @@ -10,7 +10,7 @@ const PopularNetworksList = { type: 'rpc', chainId: toHex('43114'), rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', - nickname: 'Avalanche Mainnet C-Chain', + nickname: 'Avalanche C-Chain', ticker: 'AVAX', }, }, @@ -46,7 +46,7 @@ const PopularNetworksList = { type: 'rpc', chainId: toHex('10'), rpcUrl: `https://optimism-mainnet.infura.io/v3/${infuraProjectId}`, - nickname: 'Optimism', + nickname: 'OP Mainnet', ticker: 'ETH', }, }, diff --git a/e2e/specs/ramps/deeplink-to-buy-flow-with-unsupported-network.spec.js b/e2e/specs/ramps/deeplink-to-buy-flow-with-unsupported-network.spec.js index a999cb28548..329df8acd11 100644 --- a/e2e/specs/ramps/deeplink-to-buy-flow-with-unsupported-network.spec.js +++ b/e2e/specs/ramps/deeplink-to-buy-flow-with-unsupported-network.spec.js @@ -3,7 +3,7 @@ import TestHelpers from '../../helpers'; import { loginToApp } from '../../viewHelper'; import { withFixtures } from '../../fixtures/fixture-helper'; -import { SmokeCore } from '../../tags'; +import { SmokeRamps } from '../../tags'; import FixtureBuilder from '../../fixtures/fixture-builder'; import SellGetStartedView from '../../pages/Ramps/SellGetStartedView'; @@ -13,8 +13,10 @@ import Assertions from '../../utils/Assertions'; import NetworkAddedBottomSheet from '../../pages/Network/NetworkAddedBottomSheet'; import NetworkApprovalBottomSheet from '../../pages/Network/NetworkApprovalBottomSheet'; import NetworkEducationModal from '../../pages/Network/NetworkEducationModal'; +import NetworkListModal from '../../pages/Network/NetworkListModal'; +import { PopularNetworksList } from '../../resources/networks.e2e'; -describe(SmokeCore('Buy Crypto Deeplinks'), () => { +describe(SmokeRamps('Buy Crypto Deeplinks'), () => { beforeAll(async () => { await TestHelpers.reverseServerPort(); }); @@ -23,9 +25,8 @@ describe(SmokeCore('Buy Crypto Deeplinks'), () => { jest.setTimeout(150000); }); - it('should deep link to onramp on Base network', async () => { - const BuyDeepLink = - 'metamask://buy?chainId=8453&address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amount=12'; + it('should deep link to onramp to unsupported network', async () => { + const BuyDeepLink = 'metamask://buy?chainId=2'; await withFixtures( { @@ -45,12 +46,16 @@ describe(SmokeCore('Buy Crypto Deeplinks'), () => { await BuyGetStartedView.tapGetStartedButton(); - await Assertions.checkIfVisible(NetworkApprovalBottomSheet.container); + await Assertions.checkIfTextIsDisplayed('Unsupported buy Network'); + await NetworkListModal.changeNetworkTo( + PopularNetworksList.Avalanche.providerConfig.nickname, + ); await NetworkApprovalBottomSheet.tapApproveButton(); - await NetworkAddedBottomSheet.tapSwitchToNetwork(); + await NetworkAddedBottomSheet.tapCloseButton(); await Assertions.checkIfVisible(NetworkEducationModal.container); await NetworkEducationModal.tapGotItButton(); - await Assertions.checkIfTextIsDisplayed('USD Coin'); + await Assertions.checkIfTextIsNotDisplayed('Unsupported buy Network'); + await Assertions.checkIfTextIsDisplayed('Avalanche'); }, ); }); diff --git a/e2e/specs/ramps/deeplink-to-buy-flow.spec.js b/e2e/specs/ramps/deeplink-to-buy-flow.spec.js index 0817a1949fa..df9a62b634e 100644 --- a/e2e/specs/ramps/deeplink-to-buy-flow.spec.js +++ b/e2e/specs/ramps/deeplink-to-buy-flow.spec.js @@ -3,7 +3,7 @@ import TestHelpers from '../../helpers'; import { loginToApp } from '../../viewHelper'; import { withFixtures } from '../../fixtures/fixture-helper'; -import { SmokeCore } from '../../tags'; +import { SmokeRamps } from '../../tags'; import FixtureBuilder from '../../fixtures/fixture-builder'; import SellGetStartedView from '../../pages/Ramps/SellGetStartedView'; @@ -13,7 +13,9 @@ import BuildQuoteView from '../../pages/Ramps/BuildQuoteView'; import TokenSelectBottomSheet from '../../pages/Ramps/TokenSelectBottomSheet'; import Assertions from '../../utils/Assertions'; -describe(SmokeCore('Buy Crypto Deeplinks'), () => { +import { PopularNetworksList } from '../../resources/networks.e2e'; +import NetworkEducationModal from '../../pages/Network/NetworkEducationModal'; +describe(SmokeRamps('Buy Crypto Deeplinks'), () => { beforeAll(async () => { await TestHelpers.reverseServerPort(); }); @@ -52,4 +54,38 @@ describe(SmokeCore('Buy Crypto Deeplinks'), () => { }, ); }); + it('should deep link to onramp on Base network', async () => { + const BuyDeepLink = + 'metamask://buy?chainId=8453&address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amount=12'; + + await withFixtures( + { + fixture: new FixtureBuilder() + .withPopularNetworks() + .withRampsSelectedRegion() + .build(), + restartDevice: true, + }, + async () => { + await loginToApp(); + await device.sendToHome(); + await device.launchApp({ + url: BuyDeepLink, + }); + + await Assertions.checkIfVisible( + await SellGetStartedView.getStartedButton, + ); + + await BuyGetStartedView.tapGetStartedButton(); + + await Assertions.checkIfVisible(NetworkEducationModal.container); + await NetworkEducationModal.tapGotItButton(); + await Assertions.checkIfTextIsDisplayed('USD Coin'); + await Assertions.checkIfTextIsDisplayed( + PopularNetworksList.Base.providerConfig.nickname, + ); + }, + ); + }); }); diff --git a/e2e/specs/ramps/deeplink-to-sell-flow.spec.js b/e2e/specs/ramps/deeplink-to-sell-flow.spec.js index 49b43b58cf2..279968e5902 100644 --- a/e2e/specs/ramps/deeplink-to-sell-flow.spec.js +++ b/e2e/specs/ramps/deeplink-to-sell-flow.spec.js @@ -6,15 +6,17 @@ import { withFixtures } from '../../fixtures/fixture-helper'; import TestHelpers from '../../helpers'; import SellGetStartedView from '../../pages/Ramps/SellGetStartedView'; -import { SmokeCore } from '../../tags'; +import { SmokeRamps } from '../../tags'; import BuildQuoteView from '../../pages/Ramps/BuildQuoteView'; import Assertions from '../../utils/Assertions'; import NetworkApprovalBottomSheet from '../../pages/Network/NetworkApprovalBottomSheet'; import NetworkAddedBottomSheet from '../../pages/Network/NetworkAddedBottomSheet'; import NetworkEducationModal from '../../pages/Network/NetworkEducationModal'; +import NetworkListModal from '../../pages/Network/NetworkListModal'; +import { PopularNetworksList } from '../../resources/networks.e2e'; -describe(SmokeCore('Sell Crypto Deeplinks'), () => { +describe(SmokeRamps('Sell Crypto Deeplinks'), () => { beforeAll(async () => { await TestHelpers.reverseServerPort(); }); @@ -59,8 +61,8 @@ describe(SmokeCore('Sell Crypto Deeplinks'), () => { }, ); }); - it('Should deep link to an unsupported network in the off-ramp flow', async () => { - const unsupportedNetworkSellDeepLink = 'metamask://sell?chainId=56'; + it('should deep link to offramp with Base but switch network to OP Mainnet', async () => { + const SellDeepLink = 'metamask://sell?chainId=8453'; await withFixtures( { @@ -69,20 +71,27 @@ describe(SmokeCore('Sell Crypto Deeplinks'), () => { }, async () => { await loginToApp(); - - await device.openURL({ - url: unsupportedNetworkSellDeepLink, + await device.sendToHome(); + await device.launchApp({ + url: SellDeepLink, }); await Assertions.checkIfVisible( await SellGetStartedView.getStartedButton, ); - await SellGetStartedView.tapGetStartedButton(); - + await Assertions.checkIfVisible(NetworkApprovalBottomSheet.container); + await NetworkApprovalBottomSheet.tapCancelButton(); + await NetworkListModal.changeNetworkTo( + PopularNetworksList.Optimism.providerConfig.nickname, + ); await NetworkApprovalBottomSheet.tapApproveButton(); - await NetworkAddedBottomSheet.tapSwitchToNetwork(); + await NetworkAddedBottomSheet.tapCloseButton(); await Assertions.checkIfVisible(NetworkEducationModal.container); await NetworkEducationModal.tapGotItButton(); + await Assertions.checkIfTextIsDisplayed('Ethereum'); + await Assertions.checkIfTextIsDisplayed( + PopularNetworksList.Optimism.providerConfig.nickname, + ); }, ); }); diff --git a/e2e/specs/ramps/offramp.spec.js b/e2e/specs/ramps/offramp.spec.js index b352a696427..027c6051f29 100644 --- a/e2e/specs/ramps/offramp.spec.js +++ b/e2e/specs/ramps/offramp.spec.js @@ -12,7 +12,7 @@ import { CustomNetworks } from '../../resources/networks.e2e'; import TestHelpers from '../../helpers'; import FixtureServer from '../../fixtures/fixture-server'; import { getFixturesServerPort } from '../../fixtures/utils'; -import { SmokeCore } from '../../tags'; +import { SmokeRamps } from '../../tags'; import Assertions from '../../utils/Assertions'; import SellGetStartedView from '../../pages/Ramps/SellGetStartedView'; import SelectRegionView from '../../pages/Ramps/SelectRegionView'; @@ -34,7 +34,7 @@ const PaymentMethods = { ACH_BANK_TRANSFER: 'ACH Bank Transfer', }; -describe(SmokeCore('Off-Ramp'), () => { +describe(SmokeRamps('Off-Ramp'), () => { beforeAll(async () => { await TestHelpers.reverseServerPort(); const fixture = new FixtureBuilder() diff --git a/e2e/specs/ramps/onramp.spec.js b/e2e/specs/ramps/onramp.spec.js index 6ce7d152291..be78ab9d9e9 100644 --- a/e2e/specs/ramps/onramp.spec.js +++ b/e2e/specs/ramps/onramp.spec.js @@ -11,7 +11,7 @@ import { import TestHelpers from '../../helpers'; import FixtureServer from '../../fixtures/fixture-server'; import { getFixturesServerPort } from '../../fixtures/utils'; -import { SmokeCore } from '../../tags'; +import { SmokeRamps } from '../../tags'; import BuyGetStartedView from '../../pages/Ramps/BuyGetStartedView'; import SelectRegionView from '../../pages/Ramps/SelectRegionView'; import SelectPaymentMethodView from '../../pages/Ramps/SelectPaymentMethodView'; @@ -20,7 +20,7 @@ import Assertions from '../../utils/Assertions'; const fixtureServer = new FixtureServer(); -describe(SmokeCore('Buy Crypto'), () => { +describe(SmokeRamps('Buy Crypto'), () => { beforeAll(async () => { await TestHelpers.reverseServerPort(); const fixture = new FixtureBuilder().build(); diff --git a/e2e/tags.js b/e2e/tags.js index 9d2eade9368..2d23561e08e 100644 --- a/e2e/tags.js +++ b/e2e/tags.js @@ -8,6 +8,7 @@ const tags = { smokeAssets: 'smokeAssets:', smokeIdentity: 'smokeIdentity:', smokeMultiChainPermissions: 'SmokeMultiChainPermissions:', + smokeRamps: 'SmokeRamps:', }; const Regression = (testName) => `${tags.regression} ${testName}`; @@ -18,6 +19,7 @@ const SmokeConfirmations = (testName) => const SmokeSwaps = (testName) => `${tags.SmokeSwaps} ${testName}`; const SmokeAssets = (testName) => `${tags.smokeAssets} ${testName}`; const SmokeIdentity = (testName) => `${tags.smokeIdentity} ${testName}`; +const SmokeRamps = (testName) => `${tags.smokeRamps} ${testName}`; const SmokeMultiChainPermissions = (testName) => `${tags.smokeMultiChainPermissions} ${testName}`; @@ -30,4 +32,5 @@ export { SmokeAssets, SmokeIdentity, SmokeMultiChainPermissions, + SmokeRamps, };