From 2f9265375afecc9e2828e13f237b19ce00b10add Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Fri, 29 Sep 2023 18:56:25 +0100 Subject: [PATCH 01/23] :bug: Uncomment detox tests --- Jenkinsfile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c24910499..203b16038 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,26 +19,26 @@ pipeline { } } } - // stage('Create Detox build and run end to end tests') { - // steps { - // script { - // nvm(getNodejsVersion()) { - // sh ''' - // cp env.test.json env.json - // npx react-native start & + stage('Create Detox build and run end to end tests') { + steps { + script { + nvm(getNodejsVersion()) { + sh ''' + cp env.test.json env.json + npx react-native start & - // open -a Simulator --args -CurrentDeviceUDID F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F & + open -a Simulator --args -CurrentDeviceUDID F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F & - // /usr/bin/xcrun simctl spawn F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F log stream --level debug --style compact --predicate 'process == "LiskQA"' & + /usr/bin/xcrun simctl spawn F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F log stream --level debug --style compact --predicate 'process == "LiskQA"' & - // yarn detox build --configuration ios.debug - // yarn detox test --configuration ios.debug --cleanup --headless --record-logs all - // kill -9 %1 - // ''' - // } - // } - // } - // } + yarn detox build --configuration ios.debug + yarn detox test --configuration ios.debug --cleanup --headless --record-logs all + kill -9 %1 + ''' + } + } + } + } stage('Run ESLint') { steps { nvm(getNodejsVersion()) { From 2f6940e6d5bfaae0c9b98a09fd8a7c2164f2a231 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Fri, 29 Sep 2023 23:24:55 +0100 Subject: [PATCH 02/23] :bug: Attempt using iPhone 15 --- .detoxrc.js | 2 +- e2e/packages/IntroScreen.e2e.js | 11 +++++++---- ios/Lisk.xcodeproj/project.pbxproj | 16 ++++++++-------- ios/Podfile.lock | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.detoxrc.js b/.detoxrc.js index 0e1d3cff8..0d5abc361 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -29,7 +29,7 @@ module.exports = { simulator: { type: 'ios.simulator', device: { - type: 'iPhone 14 Pro', + type: 'iPhone 15 Pro', }, }, attached: { diff --git a/e2e/packages/IntroScreen.e2e.js b/e2e/packages/IntroScreen.e2e.js index 66fe88b73..701da76a9 100644 --- a/e2e/packages/IntroScreen.e2e.js +++ b/e2e/packages/IntroScreen.e2e.js @@ -1,4 +1,4 @@ -import { device, element, by } from 'detox'; +import { device, element, by, waitFor } from 'detox'; describe('Intro Screen', () => { beforeAll(async () => { @@ -6,18 +6,21 @@ describe('Intro Screen', () => { }); it('should load intro screen', async () => { - await expect(element(by.text('Send and request tokens'))).toBeVisible(); + await waitFor(element(by.text('Manage accounts'))) + .toBeVisible() + .withTimeout(5000); + await expect(element(by.text('Manage accounts'))).toBeVisible(); }); it('should show token transfer intro screens when swiped on', async () => { await element(by.id('intro-screen')).swipe('left'); - await expect(element(by.text('A unique avatar'))).toBeVisible(); + await expect(element(by.text('Send and request tokens'))).toBeVisible(); await element(by.id('intro-screen')).swipe('left'); await expect(element(by.text('Manage blockchain application assets'))).toBeVisible(); }); it('should navigate to add account screen after intro screen', async () => { await element(by.id('continueToAddAccountButton')).tap(); - await expect(element(by.id('add-account-title')).atIndex(1)).toBeVisible(); + await expect(element(by.id('add-account-title'))).toBeVisible(); }); }); diff --git a/ios/Lisk.xcodeproj/project.pbxproj b/ios/Lisk.xcodeproj/project.pbxproj index 6de82422e..639ca98ae 100644 --- a/ios/Lisk.xcodeproj/project.pbxproj +++ b/ios/Lisk.xcodeproj/project.pbxproj @@ -61,7 +61,7 @@ 79EFB6BD2A39221F0006FBEF /* MobileProtect.plist in Resources */ = {isa = PBXBuildFile; fileRef = 79EFB6BC2A39221F0006FBEF /* MobileProtect.plist */; }; 7E342449C772440C0543475E /* libPods-LiskApp-LiskDev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADEFA1D98EA6EED99C4BE95A /* libPods-LiskApp-LiskDev.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - A23A1AEDA1EFDCFFD8819768 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; + A23A1AEDA1EFDCFFD8819768 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; CB9BAE4C26FF857E00EE1F48 /* Bridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB9BAE4B26FF857E00EE1F48 /* Bridge.swift */; }; CBD727A22A8A52DA00D33815 /* server-cert.cer in Resources */ = {isa = PBXBuildFile; fileRef = CBD727A12A8A52DA00D33815 /* server-cert.cer */; }; /* End PBXBuildFile section */ @@ -197,7 +197,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A23A1AEDA1EFDCFFD8819768 /* BuildFile in Frameworks */, + A23A1AEDA1EFDCFFD8819768 /* (null) in Frameworks */, 6113352CBF486318C1753F84 /* libPods-LiskApp-Lisk.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1546,7 +1546,7 @@ EXCLUDED_ARCHS = arm64; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; INFOPLIST_FILE = LiskDev/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 3.0.0; OTHER_LDFLAGS = ( @@ -1575,7 +1575,7 @@ EXCLUDED_ARCHS = arm64; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; INFOPLIST_FILE = LiskDev/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 3.0.0; OTHER_LDFLAGS = ( @@ -1604,7 +1604,7 @@ EXCLUDED_ARCHS = arm64; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; INFOPLIST_FILE = LiskQA/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 3.0.0; OTHER_LDFLAGS = ( @@ -1634,7 +1634,7 @@ EXCLUDED_ARCHS = arm64; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; INFOPLIST_FILE = LiskQA/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 3.0.0; OTHER_LDFLAGS = ( @@ -1683,7 +1683,7 @@ COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1745,7 +1745,7 @@ COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index c1c687de9..77b99cb95 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -920,4 +920,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 15948ed2eab00a8ddc2910ffdc1dfbe0adacd00c -COCOAPODS: 1.12.1 +COCOAPODS: 1.13.0 From b16b24af9d014e6f6a4dd5873b1e830feb74bc67 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Fri, 29 Sep 2023 23:47:24 +0100 Subject: [PATCH 03/23] :bug: Add script to select device --- .detoxrc.js | 2 +- .gitignore | 3 ++- Jenkinsfile | 19 +++++++++++++++++-- update_device.sh | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100755 update_device.sh diff --git a/.detoxrc.js b/.detoxrc.js index 0d5abc361..9ec8a560a 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -29,7 +29,7 @@ module.exports = { simulator: { type: 'ios.simulator', device: { - type: 'iPhone 15 Pro', + type: 'iPhone 15', }, }, attached: { diff --git a/.gitignore b/.gitignore index 154b8a698..95a2de105 100644 --- a/.gitignore +++ b/.gitignore @@ -82,4 +82,5 @@ android/app/src/main/assets/fonts/Gilroy-Bold.ttf .metro-health-check* # Detox artifacts -artifacts \ No newline at end of file +artifacts +.detoxrc.js.bak diff --git a/Jenkinsfile b/Jenkinsfile index 203b16038..d31eff4a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,11 +24,25 @@ pipeline { script { nvm(getNodejsVersion()) { sh ''' + # Install jq + echo "Installing jq..." + brew install jq + + # Run the update_device.sh script + echo "Running the update_device.sh script..." + chmod +x ./update_device.sh + ./update_device.sh + + # Setup and run tests cp env.test.json env.json npx react-native start & - open -a Simulator --args -CurrentDeviceUDID F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F & - + # Using a device UDID might not be required after running the script, + # but if it is, make sure to update this with the correct UDID + # after running the update_device.sh script. + open -a Simulator & + + # The line below should also be adjusted based on the device selected by the script /usr/bin/xcrun simctl spawn F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F log stream --level debug --style compact --predicate 'process == "LiskQA"' & yarn detox build --configuration ios.debug @@ -39,6 +53,7 @@ pipeline { } } } + stage('Run ESLint') { steps { nvm(getNodejsVersion()) { diff --git a/update_device.sh b/update_device.sh new file mode 100755 index 000000000..4cdf8c30e --- /dev/null +++ b/update_device.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +echo "Starting the update_device.sh script..." + +# Get the list of devices +echo "Fetching the list of devices..." +devices=$(applesimutils --list) +echo "Fetched the list of devices." + +# Extract the name and type of the first available iPhone device +echo "Extracting the name and type of the first available iPhone device..." +device_info=$(echo $devices | jq -r '.[] | select(.name | test("iPhone")) | {name: .name, type: .deviceTypeIdentifier} | @base64' | head -n 1) + +if [ -z "$device_info" ]; then + echo "Error: No iPhone device found!" + exit 1 +fi + +device_name=$(echo $device_info | base64 --decode | jq -r '.name') +device_type=$(echo $device_info | base64 --decode | jq -r '.type') +echo "Selected Device Name: $device_name" +echo "Selected Device Type: $device_type" + +# Create a backup of the .detoxrc.js file +echo "Creating a backup of the .detoxrc.js file..." +echo "Backup created as .detoxrc.js.bak." + +# Update .detoxrc.js with the new device name and type +echo "Updating .detoxrc.js with the new device name and type..." +sed -i.bak -e "s/type: 'iPhone 15 Pro'/type: '$device_name'/" -e "s/type: 'com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro'/type: '$device_type'/" .detoxrc.js +echo ".detoxrc.js has been updated." + +echo "Script execution completed." From 3c0a89553540ac07a8b86c1ae7242bbe7ff2d51b Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Fri, 29 Sep 2023 23:51:16 +0100 Subject: [PATCH 04/23] :bug: install jq from source --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d31eff4a2..a21bc9010 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,7 +26,9 @@ pipeline { sh ''' # Install jq echo "Installing jq..." - brew install jq + wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 + chmod +x ./jq + sudo mv jq /usr/local/bin # Run the update_device.sh script echo "Running the update_device.sh script..." From 354f69550ec349485ac8f60347c5d447487f6aed Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Fri, 29 Sep 2023 23:54:28 +0100 Subject: [PATCH 05/23] :bug: trying curl --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a21bc9010..d9074d2b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,7 +26,8 @@ pipeline { sh ''' # Install jq echo "Installing jq..." - wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 + echo "Installing jq..." + curl -Lo jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64 chmod +x ./jq sudo mv jq /usr/local/bin From b0e99556b5870a32e945fdc3b245e4979bcea959 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Fri, 29 Sep 2023 23:57:50 +0100 Subject: [PATCH 06/23] :ninja: testing --- Jenkinsfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d9074d2b9..82eba2c2d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,12 +24,21 @@ pipeline { script { nvm(getNodejsVersion()) { sh ''' - # Install jq - echo "Installing jq..." + # Install Homebrew + echo "Installing Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # Ensure that Homebrew is in the PATH + export PATH="/usr/local/bin:$PATH" + + # Install jq using Homebrew echo "Installing jq..." - curl -Lo jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64 - chmod +x ./jq - sudo mv jq /usr/local/bin + brew install jq + + # Install applesimutils using Homebrew + echo "Installing applesimutils..." + brew tap wix/brew + brew install wix/brew/applesimutils # Run the update_device.sh script echo "Running the update_device.sh script..." From 552bca0197204dc216b3f29acc57ee54fb6db52e Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:04:09 +0100 Subject: [PATCH 07/23] :ninja: testing --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 82eba2c2d..e03bf8ad3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,6 +24,11 @@ pipeline { script { nvm(getNodejsVersion()) { sh ''' + # Fix permissions for Homebrew + echo "Fixing permissions for Homebrew..." + sudo mkdir -p /usr/local/var/homebrew + sudo chown -R $(whoami) /usr/local/var/homebrew + # Install Homebrew echo "Installing Homebrew..." /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" From 6f8af94a8435c1b58f34d11fdfb61bf45836551d Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:09:10 +0100 Subject: [PATCH 08/23] :ninja: testing --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e03bf8ad3..5a0cb14e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,10 +36,6 @@ pipeline { # Ensure that Homebrew is in the PATH export PATH="/usr/local/bin:$PATH" - # Install jq using Homebrew - echo "Installing jq..." - brew install jq - # Install applesimutils using Homebrew echo "Installing applesimutils..." brew tap wix/brew From 8313b4a1e470e7d9331fcd5f2afa40640c631644 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:11:41 +0100 Subject: [PATCH 09/23] :ninja: testing --- Jenkinsfile | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5a0cb14e6..07de9da08 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,23 +24,6 @@ pipeline { script { nvm(getNodejsVersion()) { sh ''' - # Fix permissions for Homebrew - echo "Fixing permissions for Homebrew..." - sudo mkdir -p /usr/local/var/homebrew - sudo chown -R $(whoami) /usr/local/var/homebrew - - # Install Homebrew - echo "Installing Homebrew..." - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - - # Ensure that Homebrew is in the PATH - export PATH="/usr/local/bin:$PATH" - - # Install applesimutils using Homebrew - echo "Installing applesimutils..." - brew tap wix/brew - brew install wix/brew/applesimutils - # Run the update_device.sh script echo "Running the update_device.sh script..." chmod +x ./update_device.sh From 2851555b3a594b4691dd51f4859f160d5356b614 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:14:02 +0100 Subject: [PATCH 10/23] :arrow_back: revert --- .detoxrc.js | 2 +- Jenkinsfile | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.detoxrc.js b/.detoxrc.js index 9ec8a560a..172628e69 100644 --- a/.detoxrc.js +++ b/.detoxrc.js @@ -29,7 +29,7 @@ module.exports = { simulator: { type: 'ios.simulator', device: { - type: 'iPhone 15', + type: 'iPhone 14', }, }, attached: { diff --git a/Jenkinsfile b/Jenkinsfile index 07de9da08..203b16038 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,21 +24,11 @@ pipeline { script { nvm(getNodejsVersion()) { sh ''' - # Run the update_device.sh script - echo "Running the update_device.sh script..." - chmod +x ./update_device.sh - ./update_device.sh - - # Setup and run tests cp env.test.json env.json npx react-native start & - # Using a device UDID might not be required after running the script, - # but if it is, make sure to update this with the correct UDID - # after running the update_device.sh script. - open -a Simulator & - - # The line below should also be adjusted based on the device selected by the script + open -a Simulator --args -CurrentDeviceUDID F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F & + /usr/bin/xcrun simctl spawn F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F log stream --level debug --style compact --predicate 'process == "LiskQA"' & yarn detox build --configuration ios.debug @@ -49,7 +39,6 @@ pipeline { } } } - stage('Run ESLint') { steps { nvm(getNodejsVersion()) { From 3a3e2e41a5baa49b4a0cb449ba64d96d635681a0 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:17:27 +0100 Subject: [PATCH 11/23] :arrow_right: install xcode tools --- Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 203b16038..9b9bd1cd4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,6 +24,14 @@ pipeline { script { nvm(getNodejsVersion()) { sh ''' + # Install Command Line Tools + echo "Installing Command Line Tools..." + xcode-select --install + + # Set Xcode Path + echo "Setting Xcode Path..." + sudo xcode-select -s /Applications/Xcode.app/Contents/Developer + cp env.test.json env.json npx react-native start & From 8f1d2561fdbbfb7b963b808547b94d4b58ce5912 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:19:44 +0100 Subject: [PATCH 12/23] :arrow_left: revert --- Jenkinsfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9b9bd1cd4..ff7a3b03d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,13 +25,6 @@ pipeline { nvm(getNodejsVersion()) { sh ''' # Install Command Line Tools - echo "Installing Command Line Tools..." - xcode-select --install - - # Set Xcode Path - echo "Setting Xcode Path..." - sudo xcode-select -s /Applications/Xcode.app/Contents/Developer - cp env.test.json env.json npx react-native start & From 0ca185b2d225f4f75743a7bcce434901fdbba665 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:22:22 +0100 Subject: [PATCH 13/23] :arrow_right: Trying github action --- .github/workflows/.detox-e2e.yml | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/.detox-e2e.yml diff --git a/.github/workflows/.detox-e2e.yml b/.github/workflows/.detox-e2e.yml new file mode 100644 index 000000000..e18313dcf --- /dev/null +++ b/.github/workflows/.detox-e2e.yml @@ -0,0 +1,49 @@ +name: Detox E2E Tests + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + detox-test: + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '14.x' # Adjust to your project’s Node.js version + + - name: Install Global Dependencies + run: | + npm install -g yarn + sudo gem install cocoapods + + - name: Install Project Dependencies + run: | + yarn install + cd ios && pod install && cd .. + + - name: Install Homebrew Dependencies + run: | + brew install jq + brew tap wix/brew + brew install wix/brew/applesimutils + + - name: Start Metro Bundler + run: | + npx react-native start & + + - name: Run Detox build + run: | + yarn detox build --configuration ios.debug + + - name: Run Detox tests + run: | + yarn detox test --configuration ios.debug --cleanup --headless --record-logs all + + - name: Stop Metro Bundler + run: pkill -f "node.*react-native" From 4c7fe408b507410b75bb81f684f9082a6b2cbc24 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:24:00 +0100 Subject: [PATCH 14/23] :arrow_right: Update node version --- .github/workflows/.detox-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/.detox-e2e.yml b/.github/workflows/.detox-e2e.yml index e18313dcf..1fc66e2d4 100644 --- a/.github/workflows/.detox-e2e.yml +++ b/.github/workflows/.detox-e2e.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '14.x' # Adjust to your project’s Node.js version + node-version: '18.15.0' - name: Install Global Dependencies run: | From 84368b83e9fb5a8cf3ba6c6ff40f4b65662cd207 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:24:51 +0100 Subject: [PATCH 15/23] :arrow_right: yarn run link --- .github/workflows/.detox-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/.detox-e2e.yml b/.github/workflows/.detox-e2e.yml index 1fc66e2d4..9a1189e0c 100644 --- a/.github/workflows/.detox-e2e.yml +++ b/.github/workflows/.detox-e2e.yml @@ -24,7 +24,7 @@ jobs: - name: Install Project Dependencies run: | - yarn install + yarn install && yarn run link cd ios && pod install && cd .. - name: Install Homebrew Dependencies From 48d9704f82f73a6a6639d926d0a23b346ab19a27 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:30:29 +0100 Subject: [PATCH 16/23] :ninja: :fire: remove mobile protect --- .github/workflows/.detox-e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/.detox-e2e.yml b/.github/workflows/.detox-e2e.yml index 9a1189e0c..f62e412f0 100644 --- a/.github/workflows/.detox-e2e.yml +++ b/.github/workflows/.detox-e2e.yml @@ -24,6 +24,7 @@ jobs: - name: Install Project Dependencies run: | + yarn remove mobile-protect yarn install && yarn run link cd ios && pod install && cd .. From 27e14e8f0ecc4955ac1a010030a89cede694dd8e Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 00:40:58 +0100 Subject: [PATCH 17/23] :ninja: :fire: copy test env file --- .github/workflows/.detox-e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/.detox-e2e.yml b/.github/workflows/.detox-e2e.yml index f62e412f0..70950e726 100644 --- a/.github/workflows/.detox-e2e.yml +++ b/.github/workflows/.detox-e2e.yml @@ -26,6 +26,7 @@ jobs: run: | yarn remove mobile-protect yarn install && yarn run link + cp env.test.json env.json cd ios && pod install && cd .. - name: Install Homebrew Dependencies From 60824e0e69556e8441a59bcb436c7fb331d74a29 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Sat, 30 Sep 2023 07:39:33 +0100 Subject: [PATCH 18/23] :arrow_back: Remove github actions --- .github/workflows/.detox-e2e.yml | 51 -------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 .github/workflows/.detox-e2e.yml diff --git a/.github/workflows/.detox-e2e.yml b/.github/workflows/.detox-e2e.yml deleted file mode 100644 index 70950e726..000000000 --- a/.github/workflows/.detox-e2e.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Detox E2E Tests - -on: - pull_request: - types: [opened, synchronize, reopened] - -jobs: - detox-test: - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Set up Node - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - - name: Install Global Dependencies - run: | - npm install -g yarn - sudo gem install cocoapods - - - name: Install Project Dependencies - run: | - yarn remove mobile-protect - yarn install && yarn run link - cp env.test.json env.json - cd ios && pod install && cd .. - - - name: Install Homebrew Dependencies - run: | - brew install jq - brew tap wix/brew - brew install wix/brew/applesimutils - - - name: Start Metro Bundler - run: | - npx react-native start & - - - name: Run Detox build - run: | - yarn detox build --configuration ios.debug - - - name: Run Detox tests - run: | - yarn detox test --configuration ios.debug --cleanup --headless --record-logs all - - - name: Stop Metro Bundler - run: pkill -f "node.*react-native" From 1b1a1c5d0a07c16531907d4eb2ea12f67e50c5ac Mon Sep 17 00:00:00 2001 From: Abhishek Jalan Date: Wed, 11 Oct 2023 14:43:23 +0200 Subject: [PATCH 19/23] WIP Jenkinsfix --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ff7a3b03d..6f2e17a8f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ pipeline { # Install Command Line Tools cp env.test.json env.json npx react-native start & - + xcrun simctl boot F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F open -a Simulator --args -CurrentDeviceUDID F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F & /usr/bin/xcrun simctl spawn F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F log stream --level debug --style compact --predicate 'process == "LiskQA"' & From 7f5cc138ae29282b09f1e142efa83c9ee2d8bb34 Mon Sep 17 00:00:00 2001 From: Abhishek Jalan Date: Wed, 11 Oct 2023 14:56:44 +0200 Subject: [PATCH 20/23] added xcrun simctl boot command in jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f2e17a8f..68d534e37 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,11 +27,10 @@ pipeline { # Install Command Line Tools cp env.test.json env.json npx react-native start & + xcrun simctl shutdown F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F xcrun simctl boot F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F open -a Simulator --args -CurrentDeviceUDID F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F & - /usr/bin/xcrun simctl spawn F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F log stream --level debug --style compact --predicate 'process == "LiskQA"' & - yarn detox build --configuration ios.debug yarn detox test --configuration ios.debug --cleanup --headless --record-logs all kill -9 %1 From a97f07812cc3daa30a32d208af0d08641a8843c3 Mon Sep 17 00:00:00 2001 From: Abhishek Jalan Date: Wed, 29 Nov 2023 11:48:35 +0100 Subject: [PATCH 21/23] testing Shutdown/Boot Simulator error --- Jenkinsfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 68d534e37..ccfa43d94 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,6 +19,23 @@ pipeline { } } } + stage('Shutdown Simulator') { + steps { + script { + def deviceUdid = "F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F" + // Check if the simulator is already shut down + def isShutdown = sh(script: "xcrun simctl list devices | grep $deviceUdid | grep -q 'Shutdown'", returnStatus: true) + + if (isShutdown == 0) { + echo "Simulator $deviceUdid is already shut down." + } else { + // Shut down the simulator + sh "xcrun simctl shutdown $deviceUdid" + echo "Simulator $deviceUdid has been shut down." + } + } + } + } stage('Create Detox build and run end to end tests') { steps { script { @@ -27,7 +44,6 @@ pipeline { # Install Command Line Tools cp env.test.json env.json npx react-native start & - xcrun simctl shutdown F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F xcrun simctl boot F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F open -a Simulator --args -CurrentDeviceUDID F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F & /usr/bin/xcrun simctl spawn F084BDF1-55E5-4E4C-B4D6-70AA1DA5D41F log stream --level debug --style compact --predicate 'process == "LiskQA"' & From f9a303b63af70dd035ae5dd76781665078bc7b8b Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Tue, 19 Dec 2023 21:48:53 +0000 Subject: [PATCH 22/23] :white_check_mark: Update certificate pinning check to testnet --- src/utilities/api/APIClient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/api/APIClient.js b/src/utilities/api/APIClient.js index 6abbdc315..5193cbb55 100644 --- a/src/utilities/api/APIClient.js +++ b/src/utilities/api/APIClient.js @@ -55,7 +55,7 @@ export class APIClient { headers: finalHeaders, }; - if (this.enableCertPinning && process.env.NETWORK !== 'devnet') { + if (this.enableCertPinning && process.env.NETWORK !== 'testnet') { fetchOptions.sslPinning = { certs: ['server-cert'], }; From ddc8feb21c9232f036dc5a71c13551c40df7c6d5 Mon Sep 17 00:00:00 2001 From: Daniel Ayomide Date: Tue, 19 Dec 2023 22:05:33 +0000 Subject: [PATCH 23/23] :white_check_mark: Update send token tests --- e2e/packages/SendToken.e2e.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/packages/SendToken.e2e.js b/e2e/packages/SendToken.e2e.js index 136c87698..a6299a311 100644 --- a/e2e/packages/SendToken.e2e.js +++ b/e2e/packages/SendToken.e2e.js @@ -39,7 +39,6 @@ describe('Send Token Screen', () => { await element(by.id('fees-breakdown-toggle')).tap(); await element(by.id('send-token-screen')).atIndex(0).swipe('up'); await expect(element(by.id('initialization-fee'))).not.toBeVisible(); - await element(by.id('next-step-button')).tap(); }); it('should show transaction summary screen', async () => { @@ -54,6 +53,9 @@ describe('Send Token Screen', () => { await element(by.id('send-token-screen')).atIndex(0).swipe('up'); await expect(element(by.id('initialization-fee'))).not.toBeVisible(); await element(by.id('next-step-button')).tap(); + await waitFor(element(by.id('transaction-summary-screen'))) + .toBeVisible() + .withTimeout(1000); await expect(element(by.id('transaction-summary-screen'))).toBeVisible(); }); @@ -100,7 +102,7 @@ describe('Send Token Screen', () => { }); // TODO: Fix cross-chain test - it.skip('should successfully send a cross-chain transaction', async () => { + it('should successfully send a cross-chain transaction', async () => { device.reloadReactNative(); await element(by.id('account-list-item')).tap(); await element(by.id('send-tokens-button')).tap();