mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 01:40:12 +01:00
parent
5bdfdac01f
commit
5cf736eb88
@ -12,7 +12,7 @@ jobs:
|
||||
- restore_cache:
|
||||
key: node_modules-{{ checksum "package-lock.json" }}
|
||||
|
||||
- run: npm i
|
||||
- run: test -d node_modules || npm i
|
||||
|
||||
- save_cache:
|
||||
key: node_modules-{{ checksum "package-lock.json" }}
|
||||
|
51
.travis.yml
51
.travis.yml
@ -1,19 +1,12 @@
|
||||
# stolen from https://github.com/andstatus/todoagenda/blob/master/.travis.yml
|
||||
# stolen from:
|
||||
# https://github.com/andstatus/todoagenda/blob/master/.travis.yml
|
||||
# https://travis-ci.org/github/andstatus/todoagenda/jobs/662342170/config
|
||||
|
||||
# Based on https://travis-ci.org/ankidroid/Anki-Android/builds/624268367
|
||||
# See also https://travis-ci.community/t/is-android-28-emulator-supported/1718/6
|
||||
sudo: true
|
||||
language: bash
|
||||
# ignored on non-linux platforms, but bionic is required for nested virtualization
|
||||
dist: bionic
|
||||
|
||||
stages:
|
||||
- install
|
||||
- unit_test # custom stage defined in jobs::include section
|
||||
- test
|
||||
- finalize_coverage # custom stage defined in jobs::include section
|
||||
- cache
|
||||
|
||||
env:
|
||||
global:
|
||||
- NODE_VERSION=stable
|
||||
@ -29,36 +22,29 @@ env:
|
||||
- TOOLS=${ANDROID_HOME}/tools
|
||||
# PATH order is incredibly important. e.g. the 'emulator' script exists in more than one place!
|
||||
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
|
||||
- UNIT_TEST=FALSE # by default we don't run the unit tests, they are run only in specific builds
|
||||
- FINALIZE_COVERAGE=FALSE # by default we don't finalize coverage, it is done in one specific build
|
||||
matrix:
|
||||
- API=28
|
||||
|
||||
before_install:
|
||||
# This section may run on all platforms, and may run for unit tests or for coverage finalization
|
||||
# It should not make assumptions about os platform or desired tool installation
|
||||
|
||||
# Set up JDK 8 for Android SDK - Java is universally needed: codacy, unit tests, emulators
|
||||
# Set up JDK 8 for Android SDK
|
||||
- curl "${GRAVIS}.install-jdk-travis.sh" --output ~/.install-jdk-travis.sh
|
||||
- export TARGET_JDK="${JDK}"
|
||||
- JDK="1.8"
|
||||
- source ~/.install-jdk-travis.sh
|
||||
|
||||
# Set up Android SDK - this is needed everywhere but coverage finalization, so toggle on that
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then wget -q "${ANDROID_TOOLS_URL}" -O android-sdk-tools.zip; fi
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}; fi
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then rm android-sdk-tools.zip; fi
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then mkdir ~/.android; fi # avoid harmless sdkmanager warning
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then echo 'count=0' > ~/.android/repositories.cfg; fi # avoid harmless sdkmanager warning
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then yes | sdkmanager --licenses >/dev/null; fi # accept all sdkmanager warnings
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then echo y | sdkmanager --no_https "platform-tools" >/dev/null; fi
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then echo y | sdkmanager --no_https "tools" >/dev/null; fi # A second time per Travis docs, gets latest versions
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then echo y | sdkmanager --no_https "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null; fi # Implicit gradle dependency - gradle drives changes
|
||||
- if [ "$FINALIZE_COVERAGE" = "FALSE" ]; then echo y | sdkmanager --no_https "platforms;android-${COMPILE_API}" >/dev/null; fi # We need the API of the current compileSdkVersion from gradle.properties
|
||||
# Set up Android SDK
|
||||
- wget -q "${ANDROID_TOOLS_URL}" -O android-sdk-tools.zip
|
||||
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
|
||||
- rm android-sdk-tools.zip
|
||||
- mkdir ~/.android # avoid harmless sdkmanager warning
|
||||
- echo 'count=0' > ~/.android/repositories.cfg # avoid harmless sdkmanager warning
|
||||
- yes | sdkmanager --licenses >/dev/null # accept all sdkmanager warnings
|
||||
- echo y | sdkmanager --no_https "platform-tools" >/dev/null
|
||||
- echo y | sdkmanager --no_https "tools" >/dev/null # A second time per Travis docs, gets latest versions
|
||||
- echo y | sdkmanager --no_https "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null # Implicit gradle dependency - gradle drives changes
|
||||
- echo y | sdkmanager --no_https "platforms;android-${COMPILE_API}" >/dev/null # We need the API of the current compileSdkVersion from gradle.properties
|
||||
|
||||
install:
|
||||
# In our setup, install only runs on matrix entries we want full emulator tests on
|
||||
# That only happens currently on linux, so this section can assume linux + emulator is desired
|
||||
# Download required emulator tools
|
||||
- echo y | sdkmanager --no_https "platforms;android-$API" >/dev/null # We need the API of the emulator we will run
|
||||
- echo y | sdkmanager --no_https "emulator" >/dev/null
|
||||
@ -70,14 +56,14 @@ install:
|
||||
- sudo adduser $USER kvm
|
||||
|
||||
# Create an Android emulator
|
||||
- echo no | avdmanager create avd --force -n Pixel_API_28_AOSP -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -c 10M
|
||||
- echo no | avdmanager create avd --force -n Pixel_API_29_AOSP -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -c 10M
|
||||
- |
|
||||
EMU_PARAMS="-verbose -no-snapshot -no-window -camera-back none -camera-front none -selinux permissive -qemu -m 2048"
|
||||
EMU_COMMAND="emulator"
|
||||
# This double "sudo" monstrosity is used to have Travis execute the
|
||||
# emulator with its new group permissions and help preserve the rule
|
||||
# of least privilege.
|
||||
sudo -E sudo -u $USER -E bash -c "${ANDROID_HOME}/emulator/${EMU_COMMAND} -avd Pixel_API_28_AOSP ${AUDIO} ${EMU_PARAMS} &"
|
||||
sudo -E sudo -u $USER -E bash -c "${ANDROID_HOME}/emulator/${EMU_COMMAND} -avd Pixel_API_29_AOSP ${AUDIO} ${EMU_PARAMS} &"
|
||||
|
||||
# Wait for emulator to be ready
|
||||
- chmod +x ./tests/e2e/android-wait-for-emulator.sh
|
||||
@ -96,11 +82,12 @@ install:
|
||||
|
||||
script:
|
||||
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
|
||||
- printf "\nhw.lcd.height=1920\nhw.lcd.width=1080\nhw.lcd.density=161\nskin.name=240x426" >> /home/travis/.android/avd/Pixel_API_28_AOSP.avd/config.ini
|
||||
- printf "\nhw.lcd.height=1920\nhw.lcd.width=1080\nhw.lcd.density=320\nskin.name=1080x1920" >> /home/travis/.android/avd/Pixel_API_29_AOSP.avd/config.ini
|
||||
- npm i
|
||||
- npm i -g detox-cli
|
||||
- npm run e2e:release
|
||||
|
||||
after_failure: ./tests/e2e/upload-artifacts.sh
|
||||
|
||||
before_cache:
|
||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||
|
@ -88,6 +88,7 @@ export class BitcoinButton extends Component {
|
||||
render() {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
testID={this.props.testID}
|
||||
onPress={() => {
|
||||
// eslint-disable-next-line
|
||||
if (this.props.onPress) this.props.onPress();
|
||||
@ -576,6 +577,7 @@ export class BlueListItem extends Component {
|
||||
render() {
|
||||
return (
|
||||
<ListItem
|
||||
testID={this.props.testID}
|
||||
bottomDivider
|
||||
containerStyle={{
|
||||
backgroundColor: 'transparent',
|
||||
@ -1368,6 +1370,7 @@ export class NewWalletPanel extends Component {
|
||||
render() {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
testID="CreateAWallet"
|
||||
{...this.props}
|
||||
onPress={() => {
|
||||
if (this.handleClick) {
|
||||
@ -1924,6 +1927,7 @@ export class WalletsCarousel extends Component {
|
||||
shadowRadius={5}
|
||||
>
|
||||
<TouchableWithoutFeedback
|
||||
testID={item.getLabel()}
|
||||
onPressIn={this.onPressedIn}
|
||||
onPressOut={this.onPressedOut}
|
||||
onLongPress={WalletsCarousel.handleLongPress}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
[![GitHub tag](https://img.shields.io/badge/dynamic/json.svg?url=https://raw.githubusercontent.com/BlueWallet/BlueWallet/master/package.json&query=$.version&label=Version)](https://github.com/BlueWallet/BlueWallet)
|
||||
[![CircleCI](https://circleci.com/gh/BlueWallet/BlueWallet.svg?style=svg)](https://circleci.com/gh/BlueWallet/BlueWallet)
|
||||
[![e2e on master](https://travis-ci.com/BlueWallet/BlueWallet.svg?branch=master)](https://travis-ci.com/BlueWallet/BlueWallet)
|
||||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
|
||||
![](https://img.shields.io/github/license/BlueWallet/BlueWallet.svg)
|
||||
|
||||
|
@ -168,7 +168,6 @@ dependencies {
|
||||
androidTestImplementation('com.wix:detox:+') {
|
||||
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
|
||||
}
|
||||
androidTestImplementation 'junit:junit:4.12'
|
||||
// JSC from node_modules
|
||||
if (useIntlJsc) {
|
||||
implementation 'org.webkit:android-jsc-intl:+'
|
||||
|
28
package-lock.json
generated
28
package-lock.json
generated
@ -5410,9 +5410,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"detox": {
|
||||
"version": "15.4.2",
|
||||
"resolved": "https://registry.npmjs.org/detox/-/detox-15.4.2.tgz",
|
||||
"integrity": "sha512-nUNY8kM3T4iPqzg0KvdcpXpVc0rvbRHNAYOldCsRQZo6WlOKFdiQAD8snvp1We0Wwm0cm4UZ4/Usj/UPtFc8Uw==",
|
||||
"version": "16.0.0",
|
||||
"resolved": "https://registry.npmjs.org/detox/-/detox-16.0.0.tgz",
|
||||
"integrity": "sha512-arlcCWFhl3A+SNx6ehlVpGMrBH1FPHu38QdJGnVgnMSol84Vt85aPC4m+CkcLtfApXeow1uXadhjOrzPS0AuJQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/core": "^7.4.5",
|
||||
@ -5524,9 +5524,9 @@
|
||||
}
|
||||
},
|
||||
"yargs": {
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
|
||||
"integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
|
||||
"version": "13.3.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
|
||||
"integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cliui": "^5.0.0",
|
||||
@ -5538,13 +5538,13 @@
|
||||
"string-width": "^3.0.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^4.0.0",
|
||||
"yargs-parser": "^13.1.1"
|
||||
"yargs-parser": "^13.1.2"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "13.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
|
||||
"integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
|
||||
"version": "13.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
|
||||
"integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"camelcase": "^5.0.0",
|
||||
@ -7676,7 +7676,6 @@
|
||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
|
||||
"integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"is-glob": "^2.0.0"
|
||||
}
|
||||
@ -8189,8 +8188,7 @@
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
|
||||
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"is-finite": {
|
||||
"version": "1.0.2",
|
||||
@ -8222,7 +8220,6 @@
|
||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
|
||||
"integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"is-extglob": "^1.0.0"
|
||||
}
|
||||
@ -13422,8 +13419,7 @@
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
|
@ -9,7 +9,7 @@
|
||||
"babel-eslint": "^10.0.2",
|
||||
"babel-jest": "^24.8.0",
|
||||
"babel-preset-flow": "^6.23.0",
|
||||
"detox": "15.4.2",
|
||||
"detox": "16.0.0",
|
||||
"eslint": "^6.0.1",
|
||||
"eslint-plugin-babel": "^5.3.0",
|
||||
"eslint-plugin-import": "^2.18.0",
|
||||
@ -39,7 +39,7 @@
|
||||
"postinstall": "./node_modules/.bin/rn-nodeify --install buffer,events,process,stream,util,inherits,fs,path --hack; npm run releasenotes2json; npm run podinstall; npx jetify",
|
||||
"test": "npm run unit && npm run jest && npm run lint",
|
||||
"jest": "node node_modules/jest/bin/jest.js tests/integration/*",
|
||||
"e2e:release": "detox build -c android.emu.release; detox test -c android.emu.release --cleanup",
|
||||
"e2e:release": "detox build -c android.emu.release; detox test -c android.emu.release --record-videos all --take-screenshots all --headless --cleanup",
|
||||
"e2e:debug": "test -f android/app/build/outputs/apk/debug/app-debug.apk || detox build -c android.emu.debug; detox test -c android.emu.debug --cleanup",
|
||||
"lint": "./node_modules/.bin/eslint *.js screen/**/*.js screen/ class/ models/ loc/ tests/integration/ tests/e2e/",
|
||||
"lint:fix": "./node_modules/.bin/eslint *.js screen/**/*.js screen/ class/ models/ loc/ tests/integration/ tests/e2e/ --fix",
|
||||
@ -163,7 +163,7 @@
|
||||
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
|
||||
"type": "android.emulator",
|
||||
"device": {
|
||||
"avdName": "Pixel_API_28_AOSP"
|
||||
"avdName": "Pixel_API_29_AOSP"
|
||||
}
|
||||
},
|
||||
"android.emu.release": {
|
||||
@ -171,7 +171,7 @@
|
||||
"build": "# deleting old artifacts\nfind | grep '\\.apk' --color=never | grep -v node_modules | xargs -l rm\n\n# creating fresh keystore\nrm detox.keystore\nkeytool -genkeypair -v -keystore detox.keystore -alias detox -keyalg RSA -keysize 2048 -validity 10000 -storepass 123456 -keypass 123456 -dname 'cn=Unknown, ou=Unknown, o=Unknown, c=Unknown'\n\n# building release APK\ncd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..\n\n# backup & sign apk1\ncp ./android/app/build/outputs/apk/release/app-release-unsigned.apk ./android/app/build/outputs/apk/release/app-release-unsigned.apk.bak\njarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore detox.keystore ./android/app/build/outputs/apk/release/app-release-unsigned.apk detox -storepass 123456\n\n# move apk1 to expected filename\nmv ./android/app/build/outputs/apk/release/app-release-unsigned.apk ./android/app/build/outputs/apk/release/app-release.apk\n\n# backup and sign apk2\ncp android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk.bak\njarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore detox.keystore android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk detox -storepass 123456",
|
||||
"type": "android.emulator",
|
||||
"device": {
|
||||
"avdName": "Pixel_API_28_AOSP"
|
||||
"avdName": "Pixel_API_29_AOSP"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -65,7 +65,12 @@ export const Settings = () => {
|
||||
{BlueApp.getWallets().length > 1 && (
|
||||
<BlueListItem component={TouchableOpacity} onPress={() => navigate('DefaultView')} title="On Launch" />
|
||||
)}
|
||||
<BlueListItem title={loc.settings.encrypt_storage} onPress={() => navigate('EncryptStorage')} component={TouchableOpacity} />
|
||||
<BlueListItem
|
||||
testID="EncryptStorageButton"
|
||||
title={loc.settings.encrypt_storage}
|
||||
onPress={() => navigate('EncryptStorage')}
|
||||
component={TouchableOpacity}
|
||||
/>
|
||||
{biometrics.isDeviceBiometricCapable && (
|
||||
<BlueListItem
|
||||
hideChevron
|
||||
|
@ -116,6 +116,7 @@ export default class WalletsAdd extends Component {
|
||||
}}
|
||||
>
|
||||
<TextInput
|
||||
testID="WalletNameInput"
|
||||
value={this.state.label}
|
||||
placeholderTextColor="#81868e"
|
||||
placeholder="my first wallet"
|
||||
@ -141,6 +142,7 @@ export default class WalletsAdd extends Component {
|
||||
}}
|
||||
>
|
||||
<BitcoinButton
|
||||
testID="ActivateBitcoinButton"
|
||||
active={this.state.activeBitcoin}
|
||||
onPress={() => {
|
||||
Keyboard.dismiss();
|
||||
@ -225,6 +227,7 @@ export default class WalletsAdd extends Component {
|
||||
>
|
||||
{!this.state.isLoading ? (
|
||||
<BlueButton
|
||||
testID="Create"
|
||||
title={loc.wallets.add.create}
|
||||
disabled={this.state.activeBitcoin === undefined}
|
||||
onPress={() => {
|
||||
|
@ -315,7 +315,11 @@ export default class WalletsList extends Component {
|
||||
renderNavigationHeader = () => {
|
||||
return (
|
||||
<View style={{ height: 44, alignItems: 'flex-end', justifyContent: 'center' }}>
|
||||
<TouchableOpacity style={{ marginHorizontal: 16 }} onPress={() => this.props.navigation.navigate('Settings')}>
|
||||
<TouchableOpacity
|
||||
testID="SettingsButton"
|
||||
style={{ marginHorizontal: 16 }}
|
||||
onPress={() => this.props.navigation.navigate('Settings')}
|
||||
>
|
||||
<Icon size={22} name="kebab-horizontal" type="octicon" color={BlueApp.settings.foregroundColor} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
@ -53,10 +53,10 @@ export default class PleaseBackup extends Component {
|
||||
|
||||
return (
|
||||
<SafeBlueArea style={{ flex: 1 }}>
|
||||
<ScrollView contentContainerStyle={{ justifyContent: 'space-between' }}>
|
||||
<ScrollView contentContainerStyle={{ justifyContent: 'space-between' }} testID="PleaseBackupScrollView">
|
||||
<View style={{ alignItems: 'center', paddingHorizontal: 16 }}>
|
||||
<BlueText style={{ textAlign: 'center', fontWeight: 'bold', color: '#0C2550' }}>{loc.pleasebackup.success}</BlueText>
|
||||
<BlueText style={{ paddingBottom: 20, paddingRight: 20, paddingLeft: 20, color: '#0C2550' }}>{loc.pleasebackup.text}</BlueText>
|
||||
<BlueText style={{ paddingBottom: 10, paddingRight: 0, paddingLeft: 0, color: '#0C2550' }}>{loc.pleasebackup.text}</BlueText>
|
||||
|
||||
<View
|
||||
style={{
|
||||
@ -64,7 +64,7 @@ export default class PleaseBackup extends Component {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'center',
|
||||
flexWrap: 'wrap',
|
||||
marginTop: 24,
|
||||
marginTop: 14,
|
||||
}}
|
||||
>
|
||||
<View style={{ width: 'auto', marginRight: 8, marginBottom: 8 }}>
|
||||
@ -405,10 +405,10 @@ export default class PleaseBackup extends Component {
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', flexWrap: 'wrap', paddingTop: 24, paddingBottom: 40 }}>
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', flexWrap: 'wrap' }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<BlueSpacing20 />
|
||||
<BlueButton onPress={() => this.props.navigation.dismiss()} title={loc.pleasebackup.ok} />
|
||||
<BlueButton testID="PleasebackupOk" onPress={() => this.props.navigation.dismiss()} title={loc.pleasebackup.ok} />
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -1,11 +1,54 @@
|
||||
/* global it, describe, expect, element, by */
|
||||
/* global it, describe, expect, element, by, waitFor, device */
|
||||
|
||||
describe('BlueWallet UI Tests', () => {
|
||||
it('Shows Wallets List screen', async () => {
|
||||
await expect(element(by.id('WalletsList'))).toBeVisible();
|
||||
it('can launch', async () => {
|
||||
await waitFor(element(by.id('WalletsList')))
|
||||
.toBeVisible()
|
||||
.withTimeout(4000);
|
||||
});
|
||||
|
||||
it('Shows Wallets List screen', async () => {
|
||||
it.skip('can encrypt storage', async () => {
|
||||
await waitFor(element(by.id('WalletsList')))
|
||||
.toBeVisible()
|
||||
.withTimeout(4000);
|
||||
await expect(element(by.id('SettingsButton'))).toBeVisible();
|
||||
await element(by.id('SettingsButton')).tap(); // detox hanges here
|
||||
|
||||
await expect(element(by.id('EncryptStorageButton'))).toBeVisible();
|
||||
});
|
||||
|
||||
it('can create wallet, reload app and it persists', async () => {
|
||||
await waitFor(element(by.id('WalletsList')))
|
||||
.toBeVisible()
|
||||
.withTimeout(4000);
|
||||
await element(by.id('CreateAWallet')).tap();
|
||||
await element(by.id('WalletNameInput')).typeText('cr34t3d\n');
|
||||
await waitFor(element(by.id('ActivateBitcoinButton')))
|
||||
.toBeVisible()
|
||||
.withTimeout(5000);
|
||||
await element(by.id('ActivateBitcoinButton')).tap();
|
||||
await element(by.id('ActivateBitcoinButton')).tap();
|
||||
// why tf we need 2 taps for it to work..? mystery
|
||||
await element(by.id('Create')).tap();
|
||||
|
||||
await waitFor(element(by.id('PleaseBackupScrollView')))
|
||||
.toBeVisible()
|
||||
.withTimeout(5000);
|
||||
|
||||
await element(by.id('PleaseBackupScrollView')).swipe('up', 'fast', 1); // in case emu screen is small and it doesnt fit
|
||||
|
||||
await waitFor(element(by.id('PleasebackupOk')))
|
||||
.toBeVisible()
|
||||
.withTimeout(5000);
|
||||
await element(by.id('PleasebackupOk')).tap();
|
||||
await expect(element(by.id('WalletsList'))).toBeVisible();
|
||||
await expect(element(by.id('cr34t3d'))).toBeVisible();
|
||||
|
||||
await device.terminateApp();
|
||||
await device.launchApp({ newInstance: true });
|
||||
await waitFor(element(by.id('WalletsList')))
|
||||
.toBeVisible()
|
||||
.withTimeout(10000);
|
||||
await expect(element(by.id('cr34t3d'))).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
@ -6,7 +6,7 @@ set +e
|
||||
|
||||
bootanim=""
|
||||
failcounter=0
|
||||
timeout_in_sec=600 # 10 minutes
|
||||
timeout_in_sec=300 # 5 minutes
|
||||
|
||||
until [[ "$bootanim" =~ "stopped" ]]; do
|
||||
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
|
||||
|
4
tests/e2e/detox-prepare-android-emu.sh
Normal file → Executable file
4
tests/e2e/detox-prepare-android-emu.sh
Normal file → Executable file
@ -1,2 +1,4 @@
|
||||
$ANDROID_HOME/tools/bin/sdkmanager "system-images;android-28;default;x86_64"
|
||||
$ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_28_AOSP -d pixel --package "system-images;android-28;default;x86_64"
|
||||
echo no | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
||||
echo no | $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP --force --package "system-images;android-28;default;x86_64"
|
||||
printf "\nhw.lcd.height=1920\nhw.lcd.width=1080\nhw.lcd.density=320\nskin.name=1080x1920" >> ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini
|
@ -25,7 +25,6 @@ beforeAll(async () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await device.launchApp({ newInstance: true });
|
||||
console.log('sleeping for logo animation...');
|
||||
await sleep(2000);
|
||||
await adapter.beforeEach();
|
||||
});
|
||||
|
16
tests/e2e/upload-artifacts.sh
Executable file
16
tests/e2e/upload-artifacts.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo uploading artifacts...
|
||||
cp ./android/app/build/outputs/apk/release/app-release.apk ./artifacts/
|
||||
cp ./android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk ./artifacts/
|
||||
cp ~/.android/avd/Pixel_API_29_AOSP.avd/config.ini ./artifacts/
|
||||
tar -cvzf artifacts.tar.gz artifacts
|
||||
FILENAME="artifacts.tar.gz"
|
||||
HASH=`date +%s`
|
||||
FILENAME_UNIQ="$HASH.tar.gz"
|
||||
cp "$FILENAME" "$FILENAME_UNIQ"
|
||||
curl "http://filestorage.bluewallet.io:1488/upload.php" -F "fileToUpload=@$FILENAME_UNIQ"
|
||||
rm "$FILENAME_UNIQ"
|
||||
DLOAD="http://filestorage.bluewallet.io:1488/$HASH.tar.gz"
|
||||
echo artifacts download link:
|
||||
echo $DLOAD
|
@ -5,6 +5,7 @@ global.crypto = require('crypto'); // shall be used by tests under nodejs CLI, b
|
||||
let assert = require('assert');
|
||||
global.net = require('net'); // needed by Electrum client. For RN it is proviced in shim.js
|
||||
let BlueElectrum = require('../../BlueElectrum');
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 150 * 1000;
|
||||
|
||||
afterAll(async () => {
|
||||
// after all tests we close socket so the test suite can actually terminate
|
||||
@ -20,7 +21,6 @@ beforeAll(async () => {
|
||||
|
||||
describe('HDSegwitBech32Transaction', () => {
|
||||
it('can decode & check sequence', async function() {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30 * 1000;
|
||||
let T = new HDSegwitBech32Transaction(null, 'e9ef58baf4cff3ad55913a360c2fa1fd124309c59dcd720cdb172ce46582097b');
|
||||
assert.strictEqual(await T.getMaxUsedSequence(), 0xffffffff);
|
||||
assert.strictEqual(await T.isSequenceReplaceable(), false);
|
||||
@ -36,7 +36,6 @@ describe('HDSegwitBech32Transaction', () => {
|
||||
});
|
||||
|
||||
it('can tell if its our transaction', async function() {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30 * 1000;
|
||||
if (!process.env.HD_MNEMONIC_BIP84) {
|
||||
console.error('process.env.HD_MNEMONIC_BIP84 not set, skipped');
|
||||
return;
|
||||
@ -57,7 +56,6 @@ describe('HDSegwitBech32Transaction', () => {
|
||||
});
|
||||
|
||||
it('can tell tx info', async function() {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30 * 1000;
|
||||
if (!process.env.HD_MNEMONIC_BIP84) {
|
||||
console.error('process.env.HD_MNEMONIC_BIP84 not set, skipped');
|
||||
return;
|
||||
@ -97,7 +95,6 @@ describe('HDSegwitBech32Transaction', () => {
|
||||
});
|
||||
|
||||
it('can do RBF - cancel tx', async function() {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30 * 1000;
|
||||
if (!process.env.HD_MNEMONIC_BIP84) {
|
||||
console.error('process.env.HD_MNEMONIC_BIP84 not set, skipped');
|
||||
return;
|
||||
@ -128,7 +125,6 @@ describe('HDSegwitBech32Transaction', () => {
|
||||
});
|
||||
|
||||
it('can do RBF - bumpfees tx', async function() {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30 * 1000;
|
||||
if (!process.env.HD_MNEMONIC_BIP84) {
|
||||
console.error('process.env.HD_MNEMONIC_BIP84 not set, skipped');
|
||||
return;
|
||||
@ -162,7 +158,6 @@ describe('HDSegwitBech32Transaction', () => {
|
||||
});
|
||||
|
||||
it('can do CPFP - bump fees', async function() {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30 * 1000;
|
||||
if (!process.env.HD_MNEMONIC_BIP84) {
|
||||
console.error('process.env.HD_MNEMONIC_BIP84 not set, skipped');
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user