-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix detox failure on jenkins #2078
base: release/3.0.1
Are you sure you want to change the base?
Changes from 20 commits
2f92653
2f6940e
b16b24a
3c0a895
354f695
b0e9955
552bca0
6f8af94
8313b4a
2851555
3a3e2e4
8f1d256
0ca185b
4c7fe40
84368b8
48d9704
27e14e8
60824e0
1b1a1c5
7f5cc13
a97f078
b79425b
a3d1831
f9a303b
ddc8feb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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(); | ||
}); | ||
}); |
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." |
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
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.