Skip to content

Commit 8994d30

Browse files
authored
QA - fix flakiness (#3582)
1 parent eb416a9 commit 8994d30

File tree

11 files changed

+30
-24
lines changed

11 files changed

+30
-24
lines changed

packages/core-mobile/app/new/features/activity/components/ActivityList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const SectionHeader = ({
144144
backgroundColor: theme.colors.$surfacePrimary
145145
}}>
146146
<Text
147+
testID="section_header"
147148
variant="heading3"
148149
sx={{
149150
color: theme.colors.$textPrimary

packages/core-mobile/e2e-appium/helpers/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ async function typeSlowly(
305305
}
306306
}
307307

308-
async function assertPerformance(start: number, expectedTime = 10000) {
308+
async function assertPerformance(start: number, expectedTime = 20000) {
309309
const end = performance.now()
310310
const totalTime = end - start
311311
const passed = totalTime <= expectedTime

packages/core-mobile/e2e-appium/pages/commonEls.page.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { actions } from '../helpers/actions'
33
import { selectors } from '../helpers/selectors'
44
import commonEls from '../locators/commonEls.loc'
55
import portfolioPage from './portfolio.page'
6+
import settingsPage from './settings.page'
67

78
class CommonElsPage {
89
get retryBtn() {
@@ -407,6 +408,13 @@ class CommonElsPage {
407408
}
408409

409410
async dismissBottomSheet(element = this.grabber) {
411+
await actions.delay(1000)
412+
const backBtn =
413+
!(await actions.getVisible(element)) &&
414+
(await actions.getVisible(this.backButton))
415+
if (backBtn) {
416+
await actions.tap(this.backButton)
417+
}
410418
await actions.waitFor(element, 30000)
411419
await actions.dragAndDrop(element, [0, 1500])
412420
await actions.delay(1000)
@@ -518,9 +526,12 @@ class CommonElsPage {
518526
await actions.waitForDisplayed(this.copied)
519527
}
520528

521-
async switchAccount(account = commonEls.secondAccount) {
529+
async switchAccount(
530+
account = commonEls.secondAccount,
531+
walletName = 'Wallet 1'
532+
) {
522533
await this.goMyWallets()
523-
await actions.tap(selectors.getById(`manage_accounts_list__${account}`))
534+
await settingsPage.tapAccount(account, walletName)
524535
}
525536

526537
async goMyWallets() {

packages/core-mobile/e2e-appium/pages/portfolio.page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ class PortfolioPage {
351351
async tapToken(token = 'Avalanche') {
352352
// It taps on the name of the token on the portfolio asset (ex - Avalanche, Bitcoin, Wrapped Ether...)
353353
token = token.replace(/^Avalanche [PX]-Chain$/, 'Avalanche')
354-
await actions.tap(
354+
await actions.click(
355355
selectors.getById(`${portfolio.portfolioTokenItem}${token}`)
356356
)
357357
}

packages/core-mobile/e2e-appium/pages/settings.page.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,6 @@ class Settings {
530530
}
531531

532532
async tapCurrency() {
533-
if (!(await actions.getVisible(this.currencyId))) {
534-
await this.swipeSettings()
535-
}
536533
await actions.tap(this.currencyId)
537534
}
538535

@@ -557,15 +554,10 @@ class Settings {
557554
await actions.tap(this.showRecoveryPhrase)
558555
}
559556

560-
async createNthAccount(
561-
account = 2,
562-
activeAccount = settings.account,
563-
walletName = 'Wallet 1'
564-
) {
565-
await this.goSettings()
566-
await this.tapManageAccountsBtn()
557+
async createNthAccount(account = 2, walletName = 'Wallet 1') {
558+
await common.goMyWallets()
567559
await this.addAccount(account, walletName)
568-
await this.selectAccount(activeAccount, walletName)
560+
await common.goBack()
569561
}
570562

571563
async tapNetworks() {

packages/core-mobile/e2e-appium/pages/transactions.page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ class TransactionsPage {
505505
await this.tapWithdraw()
506506
await this.tapNext()
507507
await actions.tap(selectors.getById(`list_item__${token}`))
508-
await actions.type(selectors.getById('fiat_amount_input'), '100')
508+
await actions.type(selectors.getById('$ fiat_amount_input '), '100')
509509
await actions.waitFor(this.errorMsg)
510510
await actions.isNotVisible(this.nextBtn)
511511
await actions.isVisible(this.nextBtnDisabled)

packages/core-mobile/e2e-appium/specs/performance/balance.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import warmup from '../../helpers/warmup'
22
import { actions } from '../../helpers/actions'
33
import portfolioPage from '../../pages/portfolio.page'
4-
import commonElsPage from '../../pages/commonEls.page'
54

65
describe('[Performance] Balance', () => {
76
it('Portfolio Performance - Balance Header', async () => {
87
await warmup()
9-
await actions.waitFor(commonElsPage.loadingSpinnerVisible)
108
const start = performance.now()
119
await portfolioPage.verifyBalanceHeader()
1210
await actions.assertPerformance(start)

packages/core-mobile/e2e-appium/specs/portfolioTab/assets/ownedTokenDetail.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ describe('Portfolio Assets', () => {
1616
xchain: ['Send']
1717
}
1818

19-
it('AVAX owned token detail', async () => {
19+
before(async () => {
2020
await warmup()
21+
})
22+
23+
it('AVAX owned token detail', async () => {
2124
await commonElsPage.filter(commonElsLoc.cChain_2)
2225
await portfolioPage.verifyOwnedTokenDetail('Avalanche', tokens.avax)
2326
})

packages/core-mobile/e2e-appium/specs/portfolioTab/defi/defi.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Portfolio tab', () => {
6060
})
6161

6262
it('Defi - Should verify the empty defi screen', async () => {
63-
await settingsPage.switchAccount('Account 2')
63+
await settingsPage.createNthAccount(3)
6464
await portfolioPage.verifyEmptyDefiScreen()
6565
})
6666
})

packages/core-mobile/e2e-appium/specs/settings/currency.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ describe('Settings', () => {
1414
await settingsPage.selectCurrency('EUR')
1515
await settingsPage.tapCurrency()
1616
await settingsPage.verifyCurrencyScreen('EUR')
17-
await commonElsPage.dismissBottomSheet()
17+
await commonElsPage.goBack()
1818
})
1919

2020
it('Currency - Should change currency back to USD', async () => {
21-
await settingsPage.goSettings()
2221
await settingsPage.tapCurrency()
2322
await settingsPage.selectCurrency('USD')
2423
await settingsPage.tapCurrency()
2524
await settingsPage.verifyCurrencyScreen('USD')
26-
await commonElsPage.dismissBottomSheet()
2725
})
2826
})

0 commit comments

Comments
 (0)