Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

major: HDKD feature #431

Merged
merged 213 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
299a4f1
create legacy account list and identities switch
hanwencheng Oct 23, 2019
1684f5e
refactor account store for legacyAccountList view
hanwencheng Oct 23, 2019
cfe94db
init identityNew screen
hanwencheng Oct 23, 2019
c7046a8
style: logo
goldsteinsveta Oct 28, 2019
a8f363d
style: color change
goldsteinsveta Oct 28, 2019
3d62488
react vector icons
goldsteinsveta Oct 28, 2019
d80de72
component: ButtonIcon
goldsteinsveta Oct 28, 2019
2302783
IdentitySwitch in header
goldsteinsveta Oct 28, 2019
1570c10
rename empty to emptyAccount
hanwencheng Oct 28, 2019
ce54939
finish identityNew screen data binding
hanwencheng Oct 28, 2019
51c16ae
Update IdentitiesSwitch.js
hanwencheng Oct 28, 2019
d13e4cf
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Oct 28, 2019
7c21fb0
style: header
goldsteinsveta Oct 28, 2019
3fb0a47
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Oct 28, 2019
3fe146d
ButtonIcon text option
goldsteinsveta Oct 28, 2019
7f614c1
remove useless isWelcome and fix lint error
hanwencheng Oct 28, 2019
27aaa78
fix typo
hanwencheng Oct 28, 2019
577d1f4
refactor LegacyAccountBackup
hanwencheng Oct 28, 2019
3401d9c
init IdentityNew
hanwencheng Oct 28, 2019
205fbdc
ButtonIcon onPress isRequired
goldsteinsveta Oct 29, 2019
cb6ddcc
font styles component
goldsteinsveta Oct 29, 2019
b571590
style: IdentitySwitch
goldsteinsveta Oct 29, 2019
7793d2f
style mop up: IdentitySwitch
goldsteinsveta Oct 29, 2019
d75b537
style chores
goldsteinsveta Oct 30, 2019
800ede0
style: listed cards
goldsteinsveta Oct 30, 2019
bbe3bf4
basic account creation for identity backup screen
hanwencheng Oct 30, 2019
8a5d986
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Oct 30, 2019
60691c2
IdentityBackup, IdentityPin, PathsList
hanwencheng Oct 30, 2019
4956572
shadow and misc styles
goldsteinsveta Oct 31, 2019
e262ca5
style mop up: listed cards
goldsteinsveta Oct 31, 2019
f1e626e
network logos
goldsteinsveta Oct 31, 2019
43f0c9d
AccountCard can function as a networkButton
goldsteinsveta Oct 31, 2019
405bc8a
style: layout containers for screens with AccountCard
goldsteinsveta Oct 31, 2019
78c681e
style and fixedPrefix prop for TextInput
goldsteinsveta Oct 31, 2019
7274e4b
fontStyle for seed phrases
goldsteinsveta Oct 31, 2019
bab50c1
unlock logic, new seed generation, path derivation
hanwencheng Oct 31, 2019
62bd973
prepared place for identityList
goldsteinsveta Nov 1, 2019
6bd0fa6
integrate idenity serializer
hanwencheng Nov 1, 2019
709cc56
add and move specs to certain foler
hanwencheng Nov 1, 2019
3db9171
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 1, 2019
f5acd00
Button props
goldsteinsveta Nov 1, 2019
41c239c
show path with netwok
hanwencheng Nov 1, 2019
74c5e6f
merge
goldsteinsveta Nov 1, 2019
8502d11
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Nov 1, 2019
1f6df62
data bind with derivation path screen
hanwencheng Nov 1, 2019
92992ed
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
hanwencheng Nov 1, 2019
8c5730a
remove navigationOptions and refactoring to stateless component
hanwencheng Nov 1, 2019
a2388be
finish identity recover feature
hanwencheng Nov 1, 2019
4f83d72
fix all lint warnings
hanwencheng Nov 1, 2019
7270d90
current identity label on identitiesSwitch
hanwencheng Nov 2, 2019
fd5b027
identiy management and identity backup
hanwencheng Nov 3, 2019
2019608
fix derivation and add error handling for wrong derivation path
hanwencheng Nov 3, 2019
1c7a7b8
group paths in paths list screen
hanwencheng Nov 3, 2019
6f65dc5
show path name
hanwencheng Nov 3, 2019
f1a4e6b
path details screen, delete path function
hanwencheng Nov 3, 2019
c2492c7
add Path Management Screen
hanwencheng Nov 4, 2019
2f0050b
reset disconnect behaviour
hanwencheng Nov 4, 2019
ad08dee
use accountId as address
hanwencheng Nov 4, 2019
3d596f3
ethereum account list in idenitty and remove legacy account creation
hanwencheng Nov 5, 2019
d025975
signing function for the account in identity store
hanwencheng Nov 5, 2019
9d8749e
fix according to YJ review, reset some navigation behavior
hanwencheng Nov 5, 2019
e0fbad8
Merge branch 'master' into sveta-hanwen-hdkd
hanwencheng Nov 5, 2019
ab7f101
fix some warnings
hanwencheng Nov 5, 2019
bdc5518
Update SecurityHeader.js
hanwencheng Nov 5, 2019
20d98f8
scrollable identitySwitch
Tbaut Nov 7, 2019
44a7386
show only available networks
hanwencheng Nov 7, 2019
6201210
rephrase backup identity
hanwencheng Nov 7, 2019
c0c237a
add scan buttton to the bottom
hanwencheng Nov 7, 2019
d928cca
start screen with network chooser
hanwencheng Nov 7, 2019
c31f555
conflicts
Tbaut Nov 8, 2019
c54069f
revert conflicts
Tbaut Nov 8, 2019
73ee87f
settings
Tbaut Nov 8, 2019
2212081
Revert "revert conflicts"
hanwencheng Nov 8, 2019
fcef811
e2e test for default substrate account creation
hanwencheng Nov 8, 2019
c1f29e7
e2e test for derivation hard key
hanwencheng Nov 8, 2019
866e176
show no accountt hint text on androiid
hanwencheng Nov 9, 2019
69c93bf
refactor qr scanner
hanwencheng Nov 10, 2019
c32fd84
Merge branch 'master' into sveta-hanwen-hdkd
hanwencheng Nov 10, 2019
cdb5e42
add identity management dropdown to every identity
Tbaut Nov 10, 2019
9f3d3aa
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
Tbaut Nov 10, 2019
edc256c
style: identity screen
goldsteinsveta Nov 10, 2019
8967761
fix initial errors
hanwencheng Nov 10, 2019
6fdae56
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 10, 2019
5975fb1
update account network chooser
hanwencheng Nov 10, 2019
eb63e4b
directly navigation to derivation if there is no key
hanwencheng Nov 10, 2019
1db09c9
add path id for kusama dev
hanwencheng Nov 10, 2019
ba713f5
directly account creation with ethereum account
hanwencheng Nov 10, 2019
16ff5d1
networkParams example
hanwencheng Nov 10, 2019
f863cc5
show error icon if network is unknown
goldsteinsveta Nov 10, 2019
102b240
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Nov 10, 2019
3c69de0
style: pathCard for non-Substrate
goldsteinsveta Nov 11, 2019
62bdb12
style: group path
goldsteinsveta Nov 11, 2019
c1b49cf
style: substrate derivation
goldsteinsveta Nov 11, 2019
6f242df
display path of groupPaths
goldsteinsveta Nov 11, 2019
31bc423
vertical spacing for (un)grouped pathCards
goldsteinsveta Nov 11, 2019
ce8081c
fix address issue
hanwencheng Nov 11, 2019
bda3687
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 11, 2019
11ef288
btns: new derivation and scan
goldsteinsveta Nov 11, 2019
5895e0f
style: qr
goldsteinsveta Nov 11, 2019
2f78e7f
delete error handling
hanwencheng Nov 11, 2019
dca4eea
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 11, 2019
3fa5f3f
after delete non-substrate
goldsteinsveta Nov 11, 2019
70b0749
switcher style corrections
goldsteinsveta Nov 12, 2019
6759e3d
antdesign icons
goldsteinsveta Nov 12, 2019
f3367c9
icons and headings
goldsteinsveta Nov 12, 2019
570c18d
eth address render fix
goldsteinsveta Nov 12, 2019
9e86b05
heading PathsList
goldsteinsveta Nov 12, 2019
b3d2c4d
sign message bug fix, navigate to signedMessage
hanwencheng Nov 12, 2019
5eff2d4
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 12, 2019
0e88114
style details
goldsteinsveta Nov 13, 2019
c3ead11
styles: optimised for smaller screens
goldsteinsveta Nov 13, 2019
d9f1b54
ScreenHeader and ButtonMainAction components everywhere
goldsteinsveta Nov 13, 2019
6e2e845
ButtonMainAction display adjustments
goldsteinsveta Nov 13, 2019
59e5247
display logic for different user cases
goldsteinsveta Nov 13, 2019
38ded81
scan button fix
goldsteinsveta Nov 13, 2019
be7100b
security and errors
goldsteinsveta Nov 13, 2019
5689f01
upgrade detox to latest version and merge
hanwencheng Nov 13, 2019
a66d60f
use new fonts
hanwencheng Nov 13, 2019
158a6cf
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 13, 2019
bc6490b
`add legacy account` button for test backward compatibility
hanwencheng Nov 13, 2019
db2260b
add test for delete path
hanwencheng Nov 14, 2019
783a146
textInput adjustments
goldsteinsveta Nov 14, 2019
8a3a09b
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Nov 14, 2019
3b6bbab
delete idenitity
hanwencheng Nov 14, 2019
25faaf0
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 14, 2019
c4bfcfa
add currentIdentity to pathcard
hanwencheng Nov 14, 2019
6ce21d7
fix test multi item problem
hanwencheng Nov 14, 2019
90a7ff8
add mock file for scanning test
hanwencheng Nov 14, 2019
eef2635
mock recover identity and update genesisHash
hanwencheng Nov 14, 2019
bafa88a
Screens with seeds
goldsteinsveta Nov 14, 2019
e4917e7
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Nov 14, 2019
abc0fdf
screens w popups
goldsteinsveta Nov 14, 2019
8971c4d
identity (mnemonic) icon in paths
goldsteinsveta Nov 14, 2019
91fcc63
add account signing process
hanwencheng Nov 15, 2019
0bd6fef
tested signing process, and bug fixes
hanwencheng Nov 15, 2019
de5ac4a
style chores
goldsteinsveta Nov 15, 2019
f76e753
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Nov 15, 2019
612717f
correct signing process
hanwencheng Nov 15, 2019
dee8cca
improved touch, scroll and popup behaviours
goldsteinsveta Nov 15, 2019
4876341
new shadows
goldsteinsveta Nov 15, 2019
f47cb7a
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Nov 15, 2019
5a0e6c3
error test @YJ
hanwencheng Nov 15, 2019
dae5b06
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 15, 2019
fdb32c4
fix: test_substrate_sign1
pmespresso Nov 15, 2019
9f27c9f
remove test sign1
hanwencheng Nov 15, 2019
0c60e03
fix delete bugs
hanwencheng Nov 15, 2019
c5d873d
style onboarding message
goldsteinsveta Nov 15, 2019
54e16be
payload screen styling
hanwencheng Nov 15, 2019
ccacfab
fix navigation after scan
hanwencheng Nov 15, 2019
18e00b3
refactor signed screen
hanwencheng Nov 15, 2019
94c4556
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 15, 2019
432741e
button position @ios fix
goldsteinsveta Nov 16, 2019
f9f7508
icon centering @ios fix
goldsteinsveta Nov 16, 2019
66aa5d1
back from debugging
goldsteinsveta Nov 16, 2019
41a3725
lead to identitiesSwitch after deletetion
hanwencheng Nov 16, 2019
cb306a2
signed message styling
hanwencheng Nov 16, 2019
628ef95
fix signed message styling
hanwencheng Nov 16, 2019
dcd7477
fix signing in ethereum
hanwencheng Nov 16, 2019
262ad62
fix eslint with hooks
hanwencheng Nov 16, 2019
c31cca2
use async functions for setState
hanwencheng Nov 16, 2019
aaaec04
group alerts
hanwencheng Nov 16, 2019
ec1b0c3
more test cases and soft key fix
hanwencheng Nov 17, 2019
abdef9f
improve path grouping
hanwencheng Nov 17, 2019
e7e9fe9
sort list and add keys
hanwencheng Nov 17, 2019
0e0f377
hide tac buttons after first login
hanwencheng Nov 17, 2019
b05090f
put logo on left consistently
hanwencheng Nov 17, 2019
7ac26dd
use alternative for regex look behind
hanwencheng Nov 17, 2019
4ca98aa
fix e2e test
hanwencheng Nov 17, 2019
c7f7848
use switchNavigator
hanwencheng Nov 17, 2019
7831d0d
remove logs and remarks
hanwencheng Nov 17, 2019
deec818
remove useless code
hanwencheng Nov 17, 2019
4625664
copyright and use strict everywhere
hanwencheng Nov 17, 2019
d33a95a
comment out unused code
hanwencheng Nov 17, 2019
f6a2b9f
use accountId instead of address
hanwencheng Nov 17, 2019
1cef4a9
remove warnings
hanwencheng Nov 17, 2019
06e0686
remove logo when back button appear
hanwencheng Nov 17, 2019
1702b66
Use about screen instead of settings
hanwencheng Nov 17, 2019
341bf2d
fix grumbles
hanwencheng Nov 18, 2019
d952bd0
remove unused refs
hanwencheng Nov 18, 2019
7f80429
Merge branch 'master' into sveta-hanwen-hdkd
hanwencheng Nov 18, 2019
ace9df8
style fix
goldsteinsveta Nov 18, 2019
faf4ff6
back from debugging
goldsteinsveta Nov 18, 2019
7f61b75
fix card name not shown problem
hanwencheng Nov 18, 2019
842685e
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 18, 2019
1443bd7
style: Substrate TxDetails
goldsteinsveta Nov 18, 2019
c84bd36
Merge branch 'sveta-hanwen-hdkd' of https://github.com/paritytech/par…
goldsteinsveta Nov 18, 2019
e0fed40
indication of sender/recipient for PathCards
goldsteinsveta Nov 18, 2019
b037544
move duplicated code into component and fix merge error
hanwencheng Nov 18, 2019
91750a2
fix: loading error
hanwencheng Nov 18, 2019
7fbcfb2
Merge branch 'hanwen-fix-loading' into sveta-hanwen-hdkd
hanwencheng Nov 18, 2019
a2da1c8
move method to top
hanwencheng Nov 19, 2019
86d8e7a
fix naming in path derivation
hanwencheng Nov 19, 2019
f46b71c
separate soften keys from harden
hanwencheng Nov 19, 2019
a40183f
use memo to improve performance on pathslist
hanwencheng Nov 19, 2019
148786d
Revert "Merge branch 'hanwen-fix-loading' into sveta-hanwen-hdkd"
hanwencheng Nov 19, 2019
d8aafeb
UI fix, fix unclickable legacy items on legacyAccountList
hanwencheng Nov 19, 2019
943a032
TxDetails for small screen
goldsteinsveta Nov 19, 2019
c4b684d
8 * 4 = 32
goldsteinsveta Nov 19, 2019
aa986bf
fixes according to code review
hanwencheng Nov 19, 2019
9d4af89
extract onPress and use PureComponent if possible
hanwencheng Nov 20, 2019
d22e47a
add error handling for derived address generation
hanwencheng Nov 20, 2019
53d9465
fix signing
hanwencheng Nov 20, 2019
f3aa579
fix grumbles according to review
hanwencheng Nov 20, 2019
950fcab
save uppercase account id
hanwencheng Nov 20, 2019
09e8fe6
fix styling
hanwencheng Nov 20, 2019
da15a39
fix grumbles
hanwencheng Nov 21, 2019
2695486
extract function out of render method
hanwencheng Nov 21, 2019
51ceacf
Update identityManipulation.spec.js
hanwencheng Nov 21, 2019
ef64090
fix extra separator
hanwencheng Nov 21, 2019
ceb59b4
two buttons in row for small screen
goldsteinsveta Nov 22, 2019
0d1731b
styling fix
hanwencheng Nov 22, 2019
6837eef
Merge branch 'sveta-hanwen-hdkd' of github.com:paritytech/parity-sign…
hanwencheng Nov 22, 2019
97ee84c
remove extra margin
hanwencheng Nov 22, 2019
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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
extends: ["@react-native-community", "plugin:prettier/recommended"],
overrides: [
{
"files": ["e2e/*.spec.js", "e2e/init.js"],
"files": ["e2e/*.spec.js", "e2e/init.js", "e2e/e2eUtils.js"],
"rules": {
"no-undef": "off"
}
Expand All @@ -22,6 +22,7 @@ module.exports = {
},
},
rules: {
"no-bitwise": "off",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will use lint:fix to auto fix these erros by merging the master brach

"comma-dangle": ["error", "never"],
"object-curly-spacing": ["error", "always"],
"quotes": ["error", "single", { "avoidEscape": true }],
Expand Down
Binary file not shown.
57 changes: 57 additions & 0 deletions e2e/e2eUtils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

'use strict';

import testIDs from './testIDs';
const { IdentityPin } = testIDs;

export const testTap = async buttonId => await element(by.id(buttonId)).tap();

export const testVisible = async componentId =>
await expect(element(by.id(componentId))).toBeVisible();

export const testExist = async componentId =>
await expect(element(by.id(componentId))).toExist();

export const testNotExist = async componentId =>
await expect(element(by.id(componentId))).toNotExist();

export const testNotVisible = async componentId =>
await expect(element(by.id(componentId))).toBeNotVisible();

export const tapBack = async () =>
await element(by.id(testIDs.Header.headerBackButton))
.atIndex(0)
.tap();

export const testInput = async (inputId, inputText) => {
await element(by.id(inputId)).typeText(inputText);
await element(by.id(inputId)).tapReturnKey();
};

export const testScrollAndTap = async (buttonId, screenId) => {
await waitFor(element(by.id(buttonId)))
.toBeVisible()
.whileElement(by.id(screenId))
.scroll(100, 'down');
await testTap(buttonId);
};

export const testUnlockPin = async pinCode => {
await testInput(IdentityPin.unlockPinInput, pinCode);
await testTap(IdentityPin.unlockPinButton);
};
13 changes: 0 additions & 13 deletions e2e/firstTest.spec.js

This file was deleted.

143 changes: 143 additions & 0 deletions e2e/identityManipulation.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

'use strict';

import testIDs from './testIDs';
import {
tapBack,
testExist,
testInput,
testNotExist,
testNotVisible,
testScrollAndTap,
testTap,
testUnlockPin,
testVisible
} from './e2eUtils';

const {
TacScreen,
AccountNetworkChooser,
IdentitiesSwitch,
IdentityManagement,
IdentityNew,
IdentityBackup,
IdentityPin,
PathDerivation,
PathDetail,
PathsList,
SignedTx,
TxDetails
} = testIDs;

const pinCode = '123456';
const mockIdentityName = 'mockIdentity';
const substrateNetworkButtonIndex = AccountNetworkChooser.networkButton + '2'; //Need change if network list changes
const fundingPath = '//funding/0';
const mockSeedPhrase =
'split cradle example drum veteran swear cruel pizza guilt surface mansion film grant benefit educate marble cargo ignore bind include advance grunt exile grow';

const testSetUpDefaultPath = async () => {
await testInput(IdentityPin.setPin, pinCode);
await testInput(IdentityPin.confirmPin, pinCode);
await testTap(IdentityPin.submitButton);
await testVisible(AccountNetworkChooser.chooserScreen);
await testScrollAndTap(
substrateNetworkButtonIndex,
testIDs.AccountNetworkChooser.chooserScreen
);
await testUnlockPin(pinCode);
await testExist(PathsList.pathCard + '//kusama_CC2//default');
};

describe('Load test', async () => {
beforeAll(async () => {
if (device.getPlatform() === 'ios') {
await device.clearKeychain();
}
await device.launchApp({ permissions: { camera: 'YES' } });
});

it('should have account list screen', async () => {
await testVisible(TacScreen.tacView);
await testTap(TacScreen.agreePrivacyButton);
await testTap(TacScreen.agreeTacButton);
await testTap(TacScreen.nextButton);
await testVisible(AccountNetworkChooser.noAccountScreen);
});

it('recover a identity with seed phrase', async () => {
await testTap(AccountNetworkChooser.recoverButton);
await testVisible(IdentityNew.seedInput);
await element(by.id(IdentityNew.seedInput)).typeText(mockSeedPhrase);
await testInput(IdentityNew.nameInput, mockIdentityName);
await testTap(IdentityNew.recoverButton);
await testSetUpDefaultPath();
});

it('create a new identity with default substrate account', async () => {
await tapBack();
await testTap(IdentitiesSwitch.toggleButton);
await testTap(IdentitiesSwitch.addIdentityButton);
await testNotVisible(IdentityNew.seedInput);
await testTap(IdentityNew.createButton);
await testVisible(IdentityBackup.seedText);
await testTap(IdentityBackup.nextButton);
await element(by.text('Proceed')).tap();
await testSetUpDefaultPath();
});

it('derive a new key', async () => {
await testTap(PathsList.deriveButton);
await testInput(PathDerivation.nameInput, 'first one');
await testInput(PathDerivation.pathInput, fundingPath);
await testTap(PathDerivation.deriveButton);
await testUnlockPin(pinCode);
await testExist(PathsList.pathCard + `//kusama_CC2${fundingPath}`);
});

it('delete a path', async () => {
await tapBack();
await testTap(AccountNetworkChooser.networkButton + '0');
await testTap(PathsList.pathCard + `//kusama_CC2${fundingPath}`);
await testTap(PathDetail.popupMenuButton);
await testTap(PathDetail.deleteButton);
await element(by.text('Delete')).tap();
await testUnlockPin(pinCode);
await testNotExist(PathsList.pathCard + `//kusama_CC2${fundingPath}`);
});

it('should sign the transaction', async () => {
await tapBack();
await testTap(AccountNetworkChooser.scanButton);
await testScrollAndTap(TxDetails.signButton, TxDetails.scrollScreen);
await testUnlockPin(pinCode);
await testVisible(SignedTx.qrView);
});

it('delete identity', async () => {
await element(by.id(IdentitiesSwitch.toggleButton))
.atIndex(0)
.tap();
await testTap(IdentitiesSwitch.manageIdentityButton);
await testTap(IdentityManagement.popupMenuButton);
await testTap(IdentityManagement.deleteButton);
await element(by.text('Delete')).tap();
await testUnlockPin(pinCode);
await testVisible(IdentitiesSwitch.modal);
});
});
20 changes: 19 additions & 1 deletion e2e/init.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

'use strict';

const detox = require('detox');
const config = require('../package.json').detox;
const adapter = require('detox/runners/jest/adapter');
Expand All @@ -12,7 +30,7 @@ jasmine.getEnv().addReporter(adapter);
jasmine.getEnv().addReporter(specReporter);

beforeAll(async () => {
await detox.init(config);
await detox.init(config, { launchApp: false });
});

beforeEach(async () => {
Expand Down
36 changes: 36 additions & 0 deletions e2e/mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

'use strict';

import { NETWORK_LIST, SubstrateNetworkKeys } from '../src/constants';

export const signingTestIdentityPath = `//${NETWORK_LIST[SubstrateNetworkKeys.KUSAMA].pathID}//default`;

const setRemarkExtrinsicKusama =
'47900000100005301023c36776005aec2f32a34c109dc791a82edef980eec3be80da938ac9bcc68217220170000010c11111165030000fa030000e3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636dbb5aefb451e26bd64faf476301f980437d87c0d88dec1a8c7a3eb3cc82e9bbb0ec';

export const createMockSignRequest = () => ({
bounds: {
height: 1440,
origin: [],
width: 1920
},
data: '',
rawData: setRemarkExtrinsicKusama,
target: 319,
type: 'QR_CODE'
});
81 changes: 81 additions & 0 deletions e2e/testIDs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,93 @@
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.

// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

'use strict';

const testIDs = {
AccountListScreen: {
accountList: 'accountList'
},
AccountNetworkChooser: {
addNewNetworkButton: 'anc_add_button',
chooserScreen: 'anc_chooser_scree',
createButton: 'anc_create_button',
networkButton: 'anc_network_button',
noAccountScreen: 'anc_no_account_screen',
recoverButton: 'anc_recover_button',
scanButton: 'anc_scan_button',
showExistedButton: 'anc_show_existed'
},
Header: {
headerBackButton: 'header_back_button'
},
IdentitiesSwitch: {
addIdentityButton: 'identities_switch_add_identity',
manageIdentityButton: 'identities_switch_manager_button',
modal: 'identity_switch_modal',
toggleButton: 'identities_switch_toggle_button'
},
IdentityBackup: {
nextButton: 'identity_backup_next',
seedText: 'identity_backup_seed'
},
IdentityManagement: {
deleteButton: 'identity_management_delete_button',
popupMenuButton: 'identity_management_popup_menu'
},
IdentityNew: {
createButton: 'identity_new_create_button',
nameInput: 'identity_new_name_input',
recoverButton: 'identity_new_recover_button',
seedInput: 'identity_new_seed_input'
},
IdentityPin: {
confirmPin: 'identity_pin_confirm',
scrollScreen: 'identity_pin_scroll',
setPin: 'identity_pin_set',
submitButton: 'identity_submit_button',
unlockPinButton: 'identity_unlock_pin_button',
unlockPinInput: 'identity_unlock_pin_input'
},
PathDerivation: {
deriveButton: 'path_derivation_derive_button',
nameInput: 'path_derivation_name_input',
pathInput: 'path_derivation_path_input'
},
PathDetail: {
deleteButton: 'path_detail_delete_button',
popupMenuButton: 'path_detail_popup_menu_button'
},
PathsList: {
deriveButton: 'path_list_derive_button',
pathCard: 'path_list_path_card',
scanButton: 'path_list_scan_button'
},
SignedMessage: {},
SignedTx: {
qrView: 'signed_tx_qr_view'
},
TacScreen: {
agreePrivacyButton: 'tac_privacy',
agreeTacButton: 'tac_agree',
nextButton: 'tac_next',
tacView: 'tac_view'
},
TxDetails: {
scrollScreen: 'tx_details_scroll',
signButton: 'tx_details_sign_button'
}
};

Expand Down
Loading