From c386db3a84fa2b524df865f58ddc07405094d4ec Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 28 Jun 2022 15:23:19 +0400 Subject: [PATCH] Docs: Add an example for the e2e tests snapshot update (#41999) * Docs: Add an example for the e2e tests snapshot update * Add Playwright instruction --- docs/contributors/code/testing-overview.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/contributors/code/testing-overview.md b/docs/contributors/code/testing-overview.md index 1ddab1cfd1a77..f5dca7cabaf00 100644 --- a/docs/contributors/code/testing-overview.md +++ b/docs/contributors/code/testing-overview.md @@ -305,6 +305,12 @@ However, if the change was intentional, follow these steps to update the snapsho ```sh # --testPathPattern is optional but will be much faster by only running matching tests npm run test-unit -- --updateSnapshot --testPathPattern path/to/tests + +# Update snapshot for e2e tests +npm run test-e2e -- --updateSnapshot --testPathPattern path/to/e2e-tests + +# Update snapshot for Playwright +npm run test-e2e:playwright -- --update-snapshots path/to/spec ``` 1. Review the diff and ensure the changes are expected and intentional. @@ -606,7 +612,7 @@ To ensure that the editor stays performant as we add features, we monitor the im Performance tests are end-to-end tests running the editor and capturing these measures. Make sure you have an e2e testing environment ready. -To set up the e2e testing environment, checkout the Gutenberg repository and switch to the branch that you would like to test. Run the following command to prepare the environment. +To set up the e2e testing environment, checkout the Gutenberg repository and switch to the branch that you would like to test. Run the following command to prepare the environment. ``` nvm use && npm install