Run E2E tests of SWM libraries on different versions of React Native and across various configurations.
- Clone the repository and install dependencies:
git clone https://github.com/software-mansion-labs/rnos-library-matrix-tester
cd rnos-library-matrix-tester
yarn
- Create a new branch:
git checkout -b @tomekzaw/test-reanimated-3.0.0-rc.11
- Specify the version of your library in
cli/InstallYarnDependencies.sh
:
-yarn add react-native-reanimated@3.0.0-rc.10
+yarn add file:../react-native-reanimated-3.0.0-rc.11.tgz
- Optionally, choose a configuration and run a single test locally:
code run.sh
./run.sh
- Push the changes to the repository:
git add cli/InstallYarnDependencies.sh react-native-reanimated-3.0.0-rc.11.tgz
git commit -m "Test Reanimated 3.0.0-rc.11"
git push --set-upstream origin @tomekzaw/test-reanimated-3.0.0-rc.11
- Before running E2E tests on CI, make sure the repository is public so the company doesn't go bankrupt.
- Manually dispatch workflow for your branch (click here).
- Wait for the results. Please be patient, as one job usually takes from 20 to as long as 40 minutes, and only 5 jobs can be run at a time.
- Please do not commit
.tgz
files to the main branch. - Don't forget to delete your branch when you no longer use it.
- Branches older than 30 days may be removed without prior notice.
- If your branch introduces new features or bugfixes, submit a pull request.
-
.github/workflows/e2e.yml
– GitHub Actions workflow file unified for Android and iOS. Feel free to adapt the configuration matrix to your needs by modifyingjobs.E2E.strategy.matrix
. This file should directly run bash scripts from thecli/
directory without any arguments. Don't forget to set reasonable timeouts. -
app/
– this directory contains files that will be copied into the freshly created app.__tests__/e2e.test.ts
– the source code of E2E tests including setup and teardown of the clientpatches/
– diffs for patch-packagescreens/
– components mounted as screens used during E2E testingutils.ts
– implementation oftestUtils
function that lets you specifytestID
for tested components on both platforms
-
cli/
– this directory contains bash scripts that perform single step of the whole workflow. Some of them were easier to implement in JavaScript and the bash wrappers are just for the sake of consistency. These scripts should not accept and arguments or flags, all configuration should be passed via environmental variables. These scripts should be path-agnostic, meaning you shouldn't use relative paths from the scripts, useSCRIPT_DIR
instead. -
run.sh
– this script allows you to run the full workflow locally on your computer. Feel free to tweak the parameters or temporarily comment out redundant steps to shorten the feedback cycle.
- Support nightly version of React Native
- Support tvOS and web platform
- Support V8 runtime
- Support Expo bare workflow
- Rewrite Bash scripts to Python
- Run matrix tests locally using CLI
Copyright 2023, Software Mansion
The code located in this repository is licensed under the MIT License.