Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export function RepaySelectAmountFormBase({
const renderFooter = useCallback(() => {
return (
<Button
testID={canSubmit ? 'next_btn' : 'next_btn_disabled'}
size="large"
type="primary"
onPress={handleSubmit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ export const TokenGridView = ({
sx={{ lineHeight: 16 }}>
{tokenNameForDisplay}
</Text>
<View sx={{ flexDirection: 'row', flexShrink: 1 }}>
<View
testID={`grid_token_balance__${index}`}
sx={{ flexDirection: 'row', flexShrink: 1 }}>
<MaskedText
testID={`grid_token_balance__${index}`}
shouldMask={isPrivacyModeEnabled}
maskWidth={65}
numberOfLines={1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ export const TokenListView = ({
{tokenNameForDisplay}
</Text>
<MaskedText
testID={`list_token_balance__${index}`}
shouldMask={isPrivacyModeEnabled}
maskWidth={55}
sx={{ lineHeight: 16, flex: 1 }}
ellipsizeMode="tail"
numberOfLines={1}>
<View sx={{ flexDirection: 'row' }}>
<View
testID={`list_token_balance__${index}`}
sx={{ flexDirection: 'row' }}>
<SubTextNumber
number={token.balanceDisplayValue}
textVariant="body2"
Expand Down
4 changes: 2 additions & 2 deletions packages/core-mobile/e2e-appium/helpers/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ async function tap(
await waitFor(ele)
await ele.waitForEnabled()
await delay(1000)
await ele.tap()
await ele.click()
const selector = await ele.selector
console.log(`Tapped "${selector}"`)
if (expectedEle) {
try {
await waitFor(expectedEle)
} catch (e) {
if (await getVisible(ele)) {
await ele.tap()
await ele.click()
console.log(`Tapped again "${selector}"`)
} else {
console.log(`Skipping tap on "${selector}" because it is not visible`)
Expand Down
5 changes: 4 additions & 1 deletion packages/core-mobile/e2e-appium/locators/settings.loc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@ export default {
beamL1: 'Beam L1',
customAvatar: 'custom_avatar',
nameThisNetworkBtn: 'Name this network',
saveNetworkBtn: 'save_network_btn'
saveNetworkBtn: 'save_network_btn',
appIcon: 'App icon',
appIconTitle: 'Customize\nthe app icon',
default: 'Default'
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export default {
claimCard: 'claim_card',
duration: 'Duration',
confirmStake: 'confirm_stake',
reviewStakeTitle: 'Review your stake',
reviewStakeTitle: `That's it!\nReview your stake`,
claimNow: 'claim_now',
maxBtn: 'Max'
maxBtn: 'Max',
fiatAmountInput: 'fiat_amount_input'
}
13 changes: 6 additions & 7 deletions packages/core-mobile/e2e-appium/pages/commonEls.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ class CommonElsPage {
return selectors.getById(`list_item__${name}`)
}

listItemRightValue(name: string) {
return selectors.getById(`right_value__${name}`)
}

async filter(
item = commonEls.cChain_2,
filterDropdown = this.filterDropdown
Expand Down Expand Up @@ -483,14 +487,9 @@ class CommonElsPage {
await actions.tap(this.approveButton)
}

async selectDropdownItem(item: string, dropdown = this.filterDropdown) {
async selectDropdownItem(item: string) {
const ele = selectors.getBySomeText(item)
if (await actions.getVisible(ele)) {
await actions.click(ele)
} else {
await actions.click(dropdown)
await actions.tap(ele)
}
await actions.click(ele)
}

async tapDelete() {
Expand Down
4 changes: 3 additions & 1 deletion packages/core-mobile/e2e-appium/pages/portfolio.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,9 @@ class PortfolioPage {
}

async tapToken(token = 'Avalanche') {
const normalizedToken = token.replace(/\s(P|X)-Chain$/, '')
await actions.tap(
selectors.getById(`${portfolio.portfolioTokenItem}${token}`)
selectors.getById(`${portfolio.portfolioTokenItem}${normalizedToken}`)
)
}

Expand Down Expand Up @@ -552,6 +553,7 @@ class PortfolioPage {
}

async verifyOwnedTokenDetail(token: string, buttons: string[]) {
await commonElsPage.pullToRefresh()
await this.tapToken(token)
await actions.waitFor(this.tokenHeaderName(token))
await this.verifyOwnedTokenActionButtons(buttons)
Expand Down
40 changes: 40 additions & 0 deletions packages/core-mobile/e2e-appium/pages/settings.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,46 @@ class Settings {
await actions.tap(selectors.getById(`${appearance}_unselected`))
}

async tapAppIcon() {
await actions.tap(common.listItem(settings.appIcon))
}

async verifyAppIconScreen(selectedIconId: string) {
await actions.waitFor(selectors.getById(settings.appIconTitle))
const appIcons = [
'Light',
'Old',
'Bling',
'Shiny',
'Marker',
'Minimalism',
'Neon'
]
if (selectedIconId !== 'Default') {
const idx = appIcons.indexOf(selectedIconId)
if (idx !== -1) {
appIcons.splice(idx, 1)
}
appIcons.push('Default')
}
await actions.isVisible(
selectors.getById(`app_icon_${selectedIconId}_selected`)
)
for (const icon of appIcons) {
await actions.isVisible(selectors.getById(`app_icon_${icon}`))
}
}

async selectAppIcon(iconId?: string) {
if (!iconId) {
iconId = ['Light', 'Old', 'Bling', 'Shiny', 'Marker', 'Minimalism'][
Math.floor(Math.random() * 6)
] as string
}
await actions.tap(selectors.getById(`app_icon_${iconId}`))
return iconId
}

async tapSecurityAndPrivacy(needSwipe = true) {
if (needSwipe) {
await this.swipeSettings()
Expand Down
15 changes: 10 additions & 5 deletions packages/core-mobile/e2e-appium/pages/transactions.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class TransactionsPage {
}

get reviewStakeTitle() {
return selectors.getBySomeText(txLoc.reviewStakeTitle)
return selectors.getByText(txLoc.reviewStakeTitle)
}

get maxBtn() {
Expand All @@ -164,8 +164,11 @@ class TransactionsPage {
}

async dismissTransactionOnboarding() {
if (await actions.getVisible(this.transactionOnboardingNext)) {
await actions.tap(this.transactionOnboardingNext)
try {
await actions.waitFor(this.transactionOnboardingNext, 10000)
await actions.click(this.transactionOnboardingNext)
} catch (e) {
console.log('Transaction onboarding not found')
}
}

Expand Down Expand Up @@ -511,11 +514,13 @@ class TransactionsPage {
await this.tapWithdraw()
await this.tapNext()
await actions.tap(selectors.getById(`list_item__${token}`))
await actions.type(selectors.getById('$ fiat_amount_input '), '100')
await actions.waitFor(this.errorMsg)
await actions.type(selectors.getById(txLoc.fiatAmountInput), '100')
await actions.isNotVisible(this.nextBtn)
await actions.isVisible(this.nextBtnDisabled)
await commonElsPage.dismissBottomSheet()
if (await actions.getVisible(commonElsPage.bottomSheet)) {
await commonElsPage.dismissBottomSheet()
}
}

async verifyLocale(locale: string, currency: string) {
Expand Down
27 changes: 27 additions & 0 deletions packages/core-mobile/e2e-appium/specs/settings/appIcon.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import warmup from '../../helpers/warmup'
import settingsLoc from '../../locators/settings.loc'
import settings from '../../pages/settings.page'

describe('Settings', () => {
it('[Smoke] App icon - should have Default icon', async () => {
await warmup()
await settings.goSettings()
await settings.verifySettingsRow(settingsLoc.appIcon, settingsLoc.default)
await settings.tapAppIcon()
await settings.verifyAppIconScreen(settingsLoc.default)
})

it('App icon - should change app icon', async () => {
const newIcon = await settings.selectAppIcon()
await settings.verifySettingsRow(settingsLoc.appIcon, newIcon)
await settings.tapAppIcon()
await settings.verifyAppIconScreen(newIcon)
})

it('App icon - should restore Default icon', async () => {
await settings.selectAppIcon(settingsLoc.default)
await settings.verifySettingsRow(settingsLoc.appIcon, settingsLoc.default)
await settings.tapAppIcon()
await settings.verifyAppIconScreen(settingsLoc.default)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import commonPage from '../../../pages/commonEls.page'
describe('Earn', () => {
it('[Smoke] should borrow AVAX', async () => {
await warmup()
await earnPage.deposit('aave', 'AVAX', '0.0001')
await earnPage.borrow()
})

Expand Down
2 changes: 1 addition & 1 deletion packages/core-mobile/e2e-appium/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const goHeadless = isBitrise ? true : false
const goRetry = isBitrise ? 1 : 0
const iosLocalPath = process.env.E2E_LOCAL_PATH
? '/Users/eunji.song/Downloads/AvaxWalletInternal.app'
: './ios/Build/Products/Debug-iphonesimulator/AvaxWallet.app'
: './ios/build/Debug-iphonesimulator/AvaxWallet.app'
const androidLocalPath = process.env.E2E_LOCAL_PATH
? '/Users/eunji.song/Downloads/app-internal-e2e-bitrise-signed.apk'
: './android/app/build/outputs/apk/internal/debug/app-internal-debug.apk'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ export const FiatAmountInput = forwardRef<
...sx
}}>
{formatInSubTextNumber?.(Number(inputAmount ?? 0))}
<TouchableWithoutFeedback onPress={handlePress}>
<TouchableWithoutFeedback accessible={false} onPress={handlePress}>
<View
accessible={false}
style={{
paddingHorizontal: 16,
width: '100%'
Expand All @@ -163,7 +164,6 @@ export const FiatAmountInput = forwardRef<
{...props}
ref={textInputRef}
value={value}
accessibilityLabel="fiat_amount_input"
testID="fiat_amount_input"
onChangeText={handleValueChanged}
initialFontSize={60}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const GroupList = ({
{value !== undefined &&
(typeof value === 'string' ? (
<Text
testID={`right_value__${title}`}
testID={`right_value__${value}`}
variant="body1"
numberOfLines={1}
sx={{ color: '$textSecondary', ...valueSx }}>
Expand Down
Loading