-
Notifications
You must be signed in to change notification settings - Fork 666
Fix e2e ios tests #6613
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
Merged
+184
−182
Merged
Fix e2e ios tests #6613
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f7723e1
Fix e2e ios tests
janicduplessis d20efbb
Remove comment
janicduplessis 51b94d5
Update malicious dapp test
janicduplessis f8f91e1
Fix
janicduplessis c96d8c9
Test fix
janicduplessis 9e51a59
Trigger tests
janicduplessis d88aae1
Remove assert
janicduplessis c7f935b
Debug
janicduplessis 4eaf1b2
Try different api
janicduplessis b7a76fe
Restore all tests
janicduplessis c923ed8
Update android-e2e.yml
janicduplessis 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,47 @@ | ||
appId: ${APP_ID} | ||
tags: | ||
- browser | ||
- parallel | ||
--- | ||
- launchApp: | ||
clearState: true | ||
clearKeychain: true | ||
arguments: | ||
isE2ETest: true | ||
- runFlow: ../utils/Prepare.yaml | ||
- runFlow: ../utils/ImportWalletWithKey.yaml | ||
|
||
# Navigate to browser | ||
- tapOn: | ||
id: 'tab-bar-icon-DappBrowserScreen' | ||
- assertVisible: | ||
id: browser-screen | ||
- runFlow: | ||
when: | ||
# Maestro cannot interact with content in webviews on iOS so run | ||
# the flow only on Android. | ||
platform: Android | ||
commands: | ||
# tap on browser search input | ||
- tapOn: 'Search or enter website' | ||
- inputText: 'https://bx-test-dapp.vercel.app/' | ||
- pressKey: enter | ||
- assertVisible: 'Test Dapp 🌈' | ||
# tap on wallet pfp to open the control panel | ||
- tapOn: | ||
id: account-icon | ||
- tapOn: | ||
id: connect-button | ||
# control panel assertions | ||
- assertVisible: | ||
text: '.*BX Test Dapp.*' | ||
- assertVisible: | ||
text: 'Disconnect' | ||
# tap somewhere arbitrary to close the control panel sheet | ||
- tapOn: | ||
point: 50%,15% | ||
- scroll | ||
- tapOn: 'sign malicious permit' | ||
- extendedWaitUntil: | ||
visible: '.*Suspicious Transaction' | ||
timeout: 30000 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or bidirectional Unicode text that may be interpreted or compiled dif
10000
ferently 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 |
---|---|---|
|
@@ -8,6 +8,8 @@ appId: ${APP_ID} | |
- tapOn: | ||
text: '1' | ||
repeat: 4 | ||
delay: 1000 | ||
- tapOn: | ||
text: '1' | ||
repeat: 4 | ||
delay: 1000 |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -23,23 +23,24 @@ while [[ $# -gt 0 ]]; do | |
shift | ||
done | ||
|
||
# Check if we're running a transaction test | ||
if [[ $FLOW == *"transaction"* ]]; then | ||
# Check if we're running all tests or a transaction test | ||
if [[ $FLOW == *"transaction"* || $FLOW == "e2e" ]]; then | ||
echo "Transaction test detected." | ||
|
||
# Kill any existing Anvil process | ||
echo "Cleaning up any existing Anvil processes..." | ||
ANVIL_PID=$(lsof -t -i:8545 -c anvil 2>/dev/null) | ||
if [ -n "$ANVIL_PID" ]; then | ||
kill $ANVIL_PID | ||
fi | ||
sleep 1 | ||
|
||
# Start Anvil in the background | ||
echo "Starting Anvil..." | ||
yarn anvil --host 0.0.0.0 & | ||
|
||
echo "Waiting 5 seconds for Anvil to start..." | ||
|
||
# Start Anvil in the background (show logs in terminal + save to file) | ||
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 moved starting anvil when running all tests here, instead of in the ci script to make it easier to run locally. |
||
bash ./scripts/anvil.sh --host 0.0.0.0 2>&1 | grep -v "eth_" | tee anvil.log & | ||
ANVIL_PID=$! | ||
echo "Anvil started (PID: $ANVIL_PID)" | ||
|
||
# Wait for Anvil to initialize | ||
sleep 5 | ||
fi | ||
|
||
|
@@ -49,10 +50,16 @@ maestro $DEVICE -p Android test -e DEV_PKEY="$DEV_PKEY" -e APP_ID="me.rainbow" " | |
# Store the exit code | ||
EXIT_CODE=$? | ||
|
||
# Clean up | ||
ANVIL_PID=$(lsof -t -i:8545 -c anvil 2>/dev/null) | ||
# Kill the Anvil process | ||
if [ -n "$ANVIL_PID" ]; then | ||
kill $ANVIL_PID | ||
echo "Killing Anvil (PID: $ANVIL_PID)" | ||
kill "$ANVIL_PID" 2>/dev/null || true | ||
fi | ||
# kill any other processes using port 8545 | ||
kill $(lsof -t -i:8545) 2>/dev/null || true | ||
|
||
# Remove the Anvil log file | ||
rm -rf anvil.log | ||
|
||
# Exit with the test exit code | ||
exit $EXIT_CODE |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
this is really nice to document, ty.