Skip to content

Commit 3257ad3

Browse files
authored
QA - new import PK/PS wallets (#3359)
1 parent 3ea013c commit 3257ad3

File tree

20 files changed

+410
-57
lines changed

20 files changed

+410
-57
lines changed

packages/core-mobile/app/new/common/components/SimpleTextInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const SimpleTextInput = ({
1515
maxLength,
1616
autoFocus,
1717
secureTextEntry,
18-
testID = 'text_input'
18+
testID = 'input_text'
1919
}: {
2020
value: string
2121
onChangeText: (name: string) => void

packages/core-mobile/app/new/common/components/WalletCard.tsx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,32 +95,34 @@ const WalletCard = ({
9595
</View>
9696

9797
{showMoreButton && (
98-
<DropdownMenu
99-
groups={[
100-
{
101-
key: 'wallet-actions',
102-
items: getDropdownItems(wallet)
103-
}
104-
]}
105-
onPressAction={(event: { nativeEvent: { event: string } }) =>
106-
handleDropdownSelect(event.nativeEvent.event, wallet)
107-
}>
108-
<TouchableOpacity
109-
hitSlop={8}
110-
style={{
111-
minHeight: 48,
112-
paddingRight: 24,
113-
paddingLeft: 12,
114-
justifyContent: 'center',
115-
alignItems: 'center'
116-
}}>
117-
<Icons.Navigation.MoreHoriz
118-
color={colors.$textSecondary}
119-
width={20}
120-
height={20}
121-
/>
122-
</TouchableOpacity>
123-
</DropdownMenu>
98+
<View accessible={true} testID={`more_icon__${wallet.name}`}>
99+
<DropdownMenu
100+
groups={[
101+
{
102+
key: 'wallet-actions',
103+
items: getDropdownItems(wallet)
104+
}
105+
]}
106+
onPressAction={(event: { nativeEvent: { event: string } }) =>
107+
handleDropdownSelect(event.nativeEvent.event, wallet)
108+
}>
109+
<TouchableOpacity
110+
hitSlop={8}
111+
style={{
112+
minHeight: 48,
113+
paddingRight: 24,
114+
paddingLeft: 12,
115+
justifyContent: 'center',
116+
alignItems: 'center'
117+
}}>
118+
<Icons.Navigation.MoreHoriz
119+
color={colors.$textSecondary}
120+
width={20}
121+
height={20}
122+
/>
123+
</TouchableOpacity>
124+
</DropdownMenu>
125+
</View>
124126
)}
125127
</TouchableOpacity>
126128

packages/core-mobile/app/new/routes/(signedIn)/(modals)/accountSettings/importPrivateKey.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ const ImportPrivateKeyScreen = (): JSX.Element => {
7272

7373
return (
7474
<Button
75+
accessible={true}
76+
testID="import_wallet"
7577
type="primary"
7678
size="large"
7779
onPress={handleImportPrivateKey}

packages/core-mobile/app/new/routes/(signedIn)/(modals)/accountSettings/importSeedWallet.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ const ImportSeedWallet = (): React.JSX.Element => {
123123
gap: 12
124124
}}>
125125
<Button
126+
accessible={true}
127+
testID="import_wallet"
126128
size="large"
127129
type="primary"
128130
onPress={handleImport}

packages/core-mobile/app/new/routes/(signedIn)/(modals)/accountSettings/importWallet.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ const ImportWalletScreen = (): JSX.Element => {
7979
{
8080
title: 'Type in a recovery phrase',
8181
subtitle: (
82-
<Text variant="caption" sx={{ fontSize: 12, paddingTop: 4 }}>
82+
<Text
83+
testID="import_recovery_phrase_btn"
84+
variant="caption"
85+
sx={{ fontSize: 12, paddingTop: 4 }}>
8386
Access with your recovery phrase
8487
</Text>
8588
),
@@ -98,7 +101,10 @@ const ImportWalletScreen = (): JSX.Element => {
98101
{
99102
title: 'Import a private key',
100103
subtitle: (
101-
<Text variant="caption" sx={{ fontSize: 12, paddingTop: 4 }}>
104+
<Text
105+
testID="import_private_key_btn"
106+
variant="caption"
107+
sx={{ fontSize: 12, paddingTop: 4 }}>
102108
Access with an existing private key
103109
</Text>
104110
),

packages/core-mobile/app/new/routes/(signedIn)/(modals)/accountSettings/manageAccounts.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const ManageAccountsScreen = (): React.JSX.Element => {
172172
},
173173
title: (
174174
<Text
175-
testID={`manage_accounts_list__${account.name}`}
175+
testID={`manage_accounts_list__${wallet.name}__${account.name}`}
176176
variant="body1"
177177
numberOfLines={2}
178178
sx={{
@@ -210,11 +210,11 @@ const ManageAccountsScreen = (): React.JSX.Element => {
210210
onPress: () => handleSetActiveAccount(account.id),
211211
accessory: (
212212
<TouchableOpacity
213+
testID={`account_detail_icon__${wallet.name}_${account.name}`}
213214
hitSlop={16}
214215
sx={{ marginLeft: 4 }}
215216
onPress={() => gotoAccountDetails(account.id)}>
216217
<Icons.Alert.AlertCircle
217-
testID={`account_detail_icon__${wallet.name}_${account.name}`}
218218
color={colors.$textSecondary}
219219
width={18}
220220
height={18}
@@ -269,7 +269,7 @@ const ManageAccountsScreen = (): React.JSX.Element => {
269269
},
270270
title: (
271271
<Text
272-
testID={`manage_accounts_list__${account.name}`}
272+
testID={`private_key_account__${account.name}`}
273273
variant="body1"
274274
numberOfLines={2}
275275
sx={{
@@ -307,6 +307,7 @@ const ManageAccountsScreen = (): React.JSX.Element => {
307307
onPress: () => handleSetActiveAccount(account.id),
308308
accessory: (
309309
<TouchableOpacity
310+
testID={`account_detail_icon__${account.name}`}
310311
hitSlop={16}
311312
sx={{ marginLeft: 4 }}
312313
onPress={() => gotoAccountDetails(account.id)}>

packages/core-mobile/app/new/routes/(signedIn)/(modals)/accountSettings/viewPrivateKey.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const ViewPrivateKeyScreen = (): JSX.Element => {
6868
height: 120
6969
}}>
7070
<Text
71+
testID="private_key"
7172
variant="mono"
7273
selectable
7374
sx={{

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

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,49 @@ async function verifyText(text: string, ele: ChainablePromiseElement) {
242242
)
243243
}
244244

245+
async function pasteText(inputElement: ChainablePromiseElement, text: string) {
246+
const encodedText = Buffer.from(text, 'utf-8').toString('base64')
247+
if (driver.isIOS) {
248+
await driver.setClipboard(encodedText)
249+
} else {
250+
await driver.setClipboard(encodedText, 'plaintext')
251+
}
252+
253+
await waitFor(inputElement)
254+
await inputElement.longPress({
255+
x: 0,
256+
y: 0,
257+
duration: 600
258+
})
259+
260+
if (driver.isIOS) {
261+
await click(selectors.getByText('Paste'))
262+
} else {
263+
await tapXY(160, 650)
264+
}
265+
266+
await tapEnterOnKeyboard()
267+
}
268+
269+
async function tapXY(x: number, y: number) {
270+
await driver.performActions([
271+
{
272+
type: 'pointer',
273+
id: 'finger1',
274+
parameters: { pointerType: 'touch' },
275+
actions: [
276+
{ type: 'pointerMove', duration: 0, x, y },
277+
{ type: 'pointerDown', button: 0 },
278+
{ type: 'pause', duration: 100 },
279+
{ type: 'pointerUp', button: 0 }
280+
]
281+
}
282+
])
283+
}
284+
245285
export const actions = {
246286
type,
287+
pasteText,
247288
tapNumberPad,
248289
verifyElementText,
249290
waitFor,
@@ -266,5 +307,6 @@ export const actions = {
266307
scrollTo,
267308
log,
268309
getAmount,
269-
verifyText
310+
verifyText,
311+
tapXY
270312
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import onboardingPage from '../pages/onboarding.page'
2-
import settingsPage from '../pages/settings.page'
32
import { actions } from './actions'
43

54
export default async function warmup(
6-
addAccount = false,
75
mnemonic = process.env.E2E_MNEMONIC as string
86
) {
97
await onboardingPage.exitMetro()
@@ -19,9 +17,6 @@ export default async function warmup(
1917
await onboardingPage.tapNextBtnOnAvatarScreen()
2018
await onboardingPage.tapLetsGo()
2119
await onboardingPage.verifyLoggedIn()
22-
if (addAccount) {
23-
await settingsPage.createNthAccount()
24-
}
2520
}
2621

2722
export async function unlockLoggedIn(pin = '000000') {

packages/core-mobile/e2e-appium/locators/commonEls.loc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export default {
7070
usdcAddress: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
7171
ethAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
7272
delete: 'Delete',
73+
remove: 'Remove',
7374
cancel: 'Cancel',
7475
approvePopupTitle: 'Do you approve this transaction?',
7576
approvePopupSpendTitle: 'Do you approve this spend limit?',

0 commit comments

Comments
 (0)