This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Fix detox failure on jenkins #2078
Open
abhishekjalan87
wants to merge
25
commits into
release/3.0.1
Choose a base branch
from
1999-fix-detox-failure-on-jenkins-fix
base: release/3.0.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2f92653
:bug: Uncomment detox tests
Balanced02 2f6940e
:bug: Attempt using iPhone 15
Balanced02 b16b24a
:bug: Add script to select device
Balanced02 3c0a895
:bug: install jq from source
Balanced02 354f695
:bug: trying curl
Balanced02 b0e9955
:ninja: testing
Balanced02 552bca0
:ninja: testing
Balanced02 6f8af94
:ninja: testing
Balanced02 8313b4a
:ninja: testing
Balanced02 2851555
:arrow_back: revert
Balanced02 3a3e2e4
:arrow_right: install xcode tools
Balanced02 8f1d256
:arrow_left: revert
Balanced02 0ca185b
:arrow_right: Trying github action
Balanced02 4c7fe40
:arrow_right: Update node version
Balanced02 84368b8
:arrow_right: yarn run link
Balanced02 48d9704
:ninja: :fire: remove mobile protect
Balanced02 27e14e8
:ninja: :fire: copy test env file
Balanced02 60824e0
:arrow_back: Remove github actions
Balanced02 1b1a1c5
WIP Jenkinsfix
abhishekjalan87 7f5cc13
added xcrun simctl boot command in jenkinsfile
abhishekjalan87 a97f078
testing Shutdown/Boot Simulator error
abhishekjalan87 b79425b
Merge branch 'release/3.0.1' of https://github.com/LiskHQ/lisk-mobile…
Balanced02 a3d1831
Merge branch 'release/3.0.1' of https://github.com/LiskHQ/lisk-mobile…
Balanced02 f9a303b
:white_check_mark: Update certificate pinning check to testnet
Balanced02 ddc8feb
:white_check_mark: Update send token tests
Balanced02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import { device, element, by } from 'detox'; | ||
import { device, element, by, waitFor } from 'detox'; | ||
|
||
describe('Intro Screen', () => { | ||
beforeAll(async () => { | ||
await device.launchApp(); | ||
}); | ||
|
||
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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we might not need this file either, I created this cause I updated my system to latest and has iPhone 15, but @ClementeSerrano and most likely Jenkins might not have this device. So, this script is to ensure it picks the first device from the system to use. Let me know your thoughts pls. Thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree |
||
|
||
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." |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abhishekjalan87, it seems we still have an error here, we might need to run this command without necessarily throwing the error if the device is already shut down
![Screenshot 2023-10-20 at 13 36 00](https://private-user-images.githubusercontent.com/28750984/276931885-113ecbec-6667-41e8-92fa-bae4eadbaa40.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2ODE5NDUsIm5iZiI6MTcxOTY4MTY0NSwicGF0aCI6Ii8yODc1MDk4NC8yNzY5MzE4ODUtMTEzZWNiZWMtNjY2Ny00MWU4LTkyZmEtYmFlNGVhZGJhYTQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDE3MjA0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFhN2NmZGUwNmRlMTU0MGNjOTEzZTUwMjUzZTQzYjkyYTllZTIwYTUwMTVmMmIzZmRjNDhlNTQ4ZDVlOGFiYzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.tbYrC-eKprEngpJ23BN8XeOVuDrh5Xhw6R4R7TQp4e0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed this issue, now it will not throw any more error if simulator is already in shutdown state.