Skip to content
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

Unify test-e2e command in rn-tester-e2e pacakge #38701

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ jobs:
name: Run E2E tests
command: |
cd packages/rn-tester-e2e
yarn test-ios-e2e
yarn test-e2e ios

# -------------------------
# JOBS: Android E2E Tests
Expand Down Expand Up @@ -853,7 +853,7 @@ jobs:
name: Run E2E tests
command: |
cd packages/rn-tester-e2e
yarn test-android-e2e
yarn test-e2e android
# -------------------------
# JOBS: Test Android
# -------------------------
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Now, make sure that the iOS simulator/the Android emulator is up and running.
Finally, you can open a third terminal window and run:

```bash
yarn test-android-e2e # for android
yarn test-ios-e2e # for ios
yarn test-e2e android # for android
yarn test-e2e ios # for ios
```

Now you should see the RNTester app being open, and the defined test being run.
Expand Down
4 changes: 1 addition & 3 deletions packages/rn-tester-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"directory": "packages/rn-tester-e2e"
},
"scripts": {
"test": "jest --runInBand",
"test-android-e2e": "E2E_DEVICE=\"android\" yarn test",
"test-ios-e2e": "E2E_DEVICE=\"ios\" yarn test"
"test-e2e": "./scripts/run-e2e-tests.sh"
},
"devDependencies": {
"appium": "^2.0.0",
Expand Down
10 changes: 10 additions & 0 deletions packages/rn-tester-e2e/scripts/run-e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that this is a new script. Can we have it in JS instead of in bash?

This will make it more portable and JS is easier to read and reason about. Also, we have linters and formatters for it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also... can we create a folder into scripts/e2e where we put these scripts? This will keep the folder more organized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also... can we create a folder into scripts/e2e where we put these scripts? This will keep the folder more organized.

Would you like me to move all scripts related to running e2e to this folder?


# Check if an argument is provided
if [ $# -eq 0 ]; then
echo "Error: No platform provided."
exit 1
fi
szymonrybczak marked this conversation as resolved.
Show resolved Hide resolved

# Run tests
E2E_DEVICE=$1 jest --runInBand