Skip to content

Commit

Permalink
QA - clean up configs and fix tests (#1865)
Browse files Browse the repository at this point in the history
  • Loading branch information
eunjisong authored Oct 2, 2024
1 parent 842f6ce commit 973f307
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 60 deletions.
7 changes: 1 addition & 6 deletions packages/core-mobile/e2e/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
]
},
"testPathIgnorePatterns": [
"./e2e/tests/bridge",
"./e2e/tests/plusIcon/walletConnect/traderjoe.e2e.ts",
"./e2e/tests/plusIcon/walletConnect/dappEthIntegrations.e2e.ts",
"./e2e/tests/stake/claimTestnet.e2e.smoke.ts",
"./e2e/tests/plusIcon/send/sendBitcoin.e2e.ts",
"./e2e/tests/plusIcon/walletConnect/dappIntegrationsCore.e2e.smoke.ts"
"./e2e/tests/plusIcon/send/sendBitcoin.e2e.ts"
]
}
6 changes: 1 addition & 5 deletions packages/core-mobile/e2e/configs/regressionConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
]
},
"testPathIgnorePatterns": [
"<rootDir>/tests/plusIcon/walletConnect/traderjoe.e2e.ts",
"<rootDir>/tests/plusIcon/walletConnect/dappEthIntegrations.e2e.ts",
"<rootDir>/tests/plusIcon/walletConnect/dappIntegrations.e2e.dapp.ts",
"<rootDir>/tests/plusIcon/send/sendBitcoin.e2e.ts",
"<rootDir>/tests/plusIcon/walletConnect/dappIntegrationsCore.e2e.smoke.ts"
"<rootDir>/tests/plusIcon/send/sendBitcoin.e2e.ts"
]
}
8 changes: 0 additions & 8 deletions packages/core-mobile/e2e/configs/reuseStateConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,9 @@
]
},
"testPathIgnorePatterns": [
"./e2e/tests/bridge",
"./e2e/tests/plusIcon/walletConnect/traderjoe.e2e.ts",
"./e2e/tests/network/addCustomToken.smoke.e2e.ts",
"./e2e/tests/plusIcon/walletConnect/dappEthIntegrations.e2e.ts",
"./e2e/tests/network/emptyAsssets.e2e.ts",
"./e2e/tests/performance/performanceHelpUsImproveScreen.e2e.ts",
"./e2e/tests/settings/showRecoveryPhrase.e2e.smoke.ts",
"./e2e/tests/login/recoverMetaMaskWallet.e2e.smoke.ts",
"./e2e/tests/login/unlockWithRecoveryPhrase.e2e.ts",
"./e2e/tests/login/createNewWallet.e2e.smoke.ts",
"./e2e/tests/performance/performanceLaunchApp.e2e.ts",
"./e2e/tests/plusIcon/send/sendBitcoin.e2e.ts"
]
}
8 changes: 0 additions & 8 deletions packages/core-mobile/e2e/configs/smokeTestConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,5 @@
]
},
"testPathIgnorePatterns": [
"./e2e/tests/bridge",
"./e2e/tests/plusIcon/walletConnect/traderjoe.e2e.ts",
"./e2e/tests/plusIcon/send/sendSepoliaEthTo2ndAccount.e2e.ts",
"./e2e/tests/plusIcon/send/sendEthTo2ndAccount.e2e.ts",
"./e2e/tests/network/addCustomToken.smoke.e2e.ts",
"./e2e/tests/inAppBrowser/coreWebWCIntegration.e2e.smoke.ts",
"./e2e/tests/plusIcon/send/sendAvaxTo2ndAccount.e2e.smoke.ts",
".e2e/tests/stake/claimTestnet.e2e.smoke.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
]
},
"testPathIgnorePatterns": [
"./e2e/tests/stake/claimTestnet.e2e.smoke.ts"
]
}
11 changes: 1 addition & 10 deletions packages/core-mobile/e2e/configs/smokeTestConfigReuseState.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
]
},
"testPathIgnorePatterns": [
"./e2e/tests/bridge",
"./e2e/tests/plusIcon/walletConnect/traderjoe.e2e.ts",
"./e2e/tests/plusIcon/walletConnect/dappEthIntegrations.e2e.ts",
"./e2e/tests/network/emptyAsssets.e2e.ts",
"./e2e/tests/performance/performanceHelpUsImproveScreen.e2e.ts",
"./e2e/tests/login/recoverMetaMaskWallet.e2e.smoke.ts",
"./e2e/tests/login/createNewWallet.e2e.smoke.ts",
"./e2e/tests/inAppBrowser/coreWebWCIntegration.e2e.smoke.ts",
"./e2e/tests/network/addCustomToken.e2e.smoke.ts",
".e2e/tests/stake/claimTestnet.e2e.smoke.ts"
"./e2e/tests/login/recoverMetaMaskWallet.e2e.smoke.ts"
]
}
4 changes: 2 additions & 2 deletions packages/core-mobile/e2e/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ const setInputText = async (
}
}

const dismissKeyboard = async () => {
const dismissKeyboard = async (searchBarId = 'search_bar__search') => {
if (platform() === Platform.iOS) {
await element(by.id('search_bar__search')).tapReturnKey()
await element(by.id(searchBarId)).tapReturnKey()
} else {
await device.pressBack()
}
Expand Down
5 changes: 3 additions & 2 deletions packages/core-mobile/e2e/pages/connectedSites.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ class ConnectedSites {
}

async disconnectDapp(dApp: string) {
await Actions.waitForElement(by.id(`x_btn__${dApp}`), 4000, 0)
await Actions.tapElementAtIndex(by.id(`x_btn__${dApp}`), 0)
while (await Actions.isVisible(by.id(`x_btn__${dApp}`), 0)) {
await Actions.tapElementAtIndex(by.id(`x_btn__${dApp}`), 0)
}
}

async verifyEmtpyConnectedSites() {
Expand Down
7 changes: 1 addition & 6 deletions packages/core-mobile/e2e/pages/networksManage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class NetworksPage {
async tapStarSvgByNetwork(network: string) {
if (Action.platform() === Platform.iOS) {
try {
await Action.dismissKeyboard()
await Action.dismissKeyboard('network_manager__search_input')
} catch (e) {
console.log('No need to dismiss keyboard')
}
Expand Down Expand Up @@ -194,11 +194,6 @@ class NetworksPage {
}

async tapSaveButton() {
await Action.scrollListUntil(
this.saveButton,
by.id('addEditNetwork_scroll_view'),
30
)
while (await Action.isVisible(this.saveButton, 0)) {
await Action.tapElementAtIndex(this.saveButton, 0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import NetworksManagePage from '../../pages/networksManage.page'
import NetworksManageLoc from '../../locators/networksManage.loc'
import { warmup } from '../../helpers/warmup'
import commonElsPage from '../../pages/commonEls.page'
import portfolioLoc from '../../locators/portfolio.loc'

describe('Add custom network', () => {
beforeAll(async () => {
Expand Down Expand Up @@ -39,7 +38,6 @@ describe('Add custom network', () => {
)
await NetworksManagePage.swipeUp()
await NetworksManagePage.inputExplorerUrl(NetworksManageLoc.celoExplorerUrl)
await NetworksManagePage.swipeUp(NetworksManagePage.explorerUrlText)
await NetworksManagePage.tapSaveButton()
await NetworksManagePage.tapCustomTab()
await Assert.isVisible(NetworksManagePage.celoWrongNetworkName)
Expand All @@ -50,6 +48,7 @@ describe('Add custom network', () => {
await NetworksManagePage.tapDropdown()
await NetworksManagePage.tapEditNetwork()
await NetworksManagePage.inputNetworkName(NetworksManageLoc.celoNetworkName)
await NetworksManagePage.swipeUp()
await NetworksManagePage.tapSaveButton()
await NetworksManagePage.tapHeaderBack()
await Assert.isVisible(NetworksManagePage.celoNetworkName)
Expand All @@ -58,9 +57,7 @@ describe('Add custom network', () => {
it('should change active network to custom', async () => {
await NetworksManagePage.tapNetworksTab()
await NetworksManagePage.tapArbCustomNetwork()
await Actions.waitForElement(
by.id(portfolioLoc.activeNetwork + 'Arbitrum One')
)
await PortfolioPage.verifyActiveNetwork('Arbitrum One')
})

it('should delete custom network', async () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/core-mobile/e2e/tests/plusIcon/buy/buy.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { warmup } from '../../../helpers/warmup'
import bottomTabsPage from '../../../pages/bottomTabs.page'
import buyPage from '../../../pages/buy.page'
import networksManagePage from '../../../pages/networksManage.page'
import plusMenuPage from '../../../pages/plusMenu.page'

describe('Buy', () => {
beforeAll(async () => {
await warmup()
await networksManagePage.switchToAvalancheNetwork()
})

it('should navigate Moonpay to buy AVAX', async () => {
Expand Down
15 changes: 8 additions & 7 deletions packages/core-mobile/e2e/tests/stake/stakingTestnet.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ describe('Stake on Testnet', () => {
await cleanup()
})

it('should test a staking flow for a new account on testnet', async () => {
await BottomTabsPage.tapPortfolioTab()
await AccountManagePage.createNthAccountAndSwitchToNth(3)
await BottomTabsPage.tapStakeTab()
await StakePage.verifyNoActiveStakesScreenItems()
})

it('should test a staking flow on testnet for an existing account', async () => {
await BottomTabsPage.tapPortfolioTab()
await accountManagePage.switchToFirstAccount()
await BottomTabsPage.tapStakeTab()
await StakePage.tapStakeButton()
Expand Down Expand Up @@ -67,11 +75,4 @@ describe('Stake on Testnet', () => {
}
}
})

it('should test a staking flow for a new account on testnet', async () => {
await BottomTabsPage.tapPortfolioTab()
await AccountManagePage.createNthAccountAndSwitchToNth(3)
await BottomTabsPage.tapStakeTab()
await StakePage.verifyNoActiveStakesScreenItems()
})
})

0 comments on commit 973f307

Please sign in to comment.