From 60cb52a5d109104568f97240541b92e7dcc84d10 Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Tue, 9 Oct 2018 00:30:47 +0300 Subject: [PATCH] docs: update info on how to update artifacts snapshots for e2e (#973) --- docs/Guide.Contributing.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/Guide.Contributing.md b/docs/Guide.Contributing.md index 05109151a4..e7c1326da6 100644 --- a/docs/Guide.Contributing.md +++ b/docs/Guide.Contributing.md @@ -120,6 +120,18 @@ on macOS environment variables can be exported to desktop applications by adding launchctl setenv PATH $PATH ``` +##### Changing Detox e2e test suite + +If you add, rename, or delete a test in `detox/test/e2e` suite, you also have to update Jest snapshots +of expected artifacts. It is usually done in five steps: + +1. In `detox/test` project, run all end-to-end tests on iOS with `npm run e2e:ios-multi`. +2. Update the snapshots with: `npm run verify-artifacts:ios -- -u`. +3. Re-run Android tests with `npm run e2e:android`. +4. Update the snapshots with: `npm run verify-artifacts:android -- -u`. +5. Add the snapshots to your Git commit: +* Android: `detox/test/scripts/__snapshots__/verify_artifacts_are_not_missing.android.test.js.snap` +* iOS: `detox/test/scripts/__snapshots__/verify_artifacts_are_not_missing.ios.test.js.snap` #### 3. Android Native tests