wordpress-develop/tests/e2e
John Blackbourn 8d702842ce Administration: Add the no-store and private directives to the Cache-Control header when preventing caching for logged in users.
The intention behind this change is to prevent sensitive data in responses for logged in users being cached and available to others, for example via the browser history after the user logs out.

The `no-store` directive instructs caches in the browser or within proxies not to store the response in the cache. This is subtly different from the `no-cache` directive which means the response can be cached but must be revalidated before re-use. WordPress does not use ETag headers by default therefore this does not achieve the same result.

The `private` directive complements the `no-store` directive by specifying that the response contains private information that should not be stored in a public cache. Som
e proxy caches may ignore the `no-store` directive but respect the `private` directive, thus it is included.

The existing `Cache-Control` header for users who are not logged in remains unchanged, and the existing cache prevention directives remain in place for backwards compatib
ility.

Props soulseekah, luehrsen, Dharm1025, markdoliner, rutviksavsani, ayeshrajans, paulkevan, clorith, andy786, johnbillion

Fixes #21938, Fixes #57627


git-svn-id: https://develop.svn.wordpress.org/trunk@55968 602fd350-edb4-49c9-b593-d223f7449a82
2023-06-21 18:25:40 +00:00
..
config Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1. 2021-11-08 14:26:27 +00:00
specs Administration: Add the no-store and private directives to the Cache-Control header when preventing caching for logged in users. 2023-06-21 18:25:40 +00:00
jest.config.js Block Editor: Update the WordPress Packages to the ones used in the Gutenberg 6.5 release 2019-09-19 15:17:39 +00:00
README.md Build/Test Tools: Add end-to-end (e2e) tests README.md. 2021-10-12 18:50:34 +00:00
run-tests.js Build/Test Tools: Update some NPM dependencies to the latest versions. 2022-04-08 20:05:03 +00:00

E2E Tests

End-To-End (E2E) tests for WordPress.

Running the tests

The e2e tests require a production-like environment to run. By default, they will assume an environment is available at http://localhost:8889, with username=admin and password=password.

If you don't already have an environment ready, you can set one up by following these instructions.

Then you can launch the tests by running:

npm run test:e2e

which will run the test suite using a headless browser.

If your environment has a different url, username or password to the default, you can provide the base URL, username and password like this:

npm run test:e2e -- --wordpress-base-url=http://mycustomurl --wordpress-username=username --wordpress-password=password

DO NOT run these tests in an actual production environment, as they will delete all your content.

For debugging purposes, you might want to follow the test visually. You can do so by running the tests in an interactive mode.

npm run test:e2e -- --puppeteer-interactive

You can also run a single test file separately:

npm run test:e2e tests/e2e/specs/hello.test.js

Documentation