Skip to content

Commit 54c9aba

Browse files
committed
πŸ“ update security readme with latest A/B testing info
1 parent 1172750 commit 54c9aba

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

β€Žsecurity/README.mdβ€Ž

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,23 @@ Includes instructions only for how to run the tests on MacOS. (PRs welcome for i
2929

3030
## A/B end-to-end acceptance tests
3131

32-
At the moment, A/B E2E test verification for CVE fixes is done manually. We should automate this (QUnit, testem). (PRs welcome!)
32+
Tests run on every push in CI via [GitHub workflow](https://github.com/ctcpip/jquery-security-patches/actions/workflows/security-test.yml)
3333

34-
### How to run A/B end-to-end acceptance tests
34+
You can run the A/B tests locally in CI mode or manually in the browser
35+
36+
### How to run A/B end-to-end acceptance tests in CI mode
37+
38+
- Checkout the `main` branch
39+
- Run `nom test` in `/security/test`
40+
- Rejoice!
41+
42+
### How to run A/B end-to-end acceptance tests manually
3543

3644
- Checkout the `main` branch
37-
- Run the node/express server in `/security/server`: `node index.js`
38-
- Use a local webserver to serve the static files in the folder for the version you care about in this repo, e.g. `security/1.6.5-sec`.
39-
- This is trivial using something like VS Code. Just open up one of the HTML files, such as `/security/1.6.5-sec/index-1.6.4.html` and using the command palette, select `Live Preview: Show Preview (External Browser)`
40-
- Open the A HTML file (in this example that would be `index-1.6.4.html` and if you're using VS Code to serve the files, it will likely be served at `http://127.0.0.1:3000/security/1.6.5-sec/index-1.6.4.html`)
41-
- Click on every button, verifying each vulnerability manifests in the log, e.g. with an 'alert!' or 'prototype has been polluted' message. Also verify no unexpected errors appear.
42-
- Open the B HTML file (in this example that would be `index-1.6.5-sec.html` and if you're using VS Code to serve the files, it will likely be served at `http://127.0.0.1:3000/security/1.6.5-sec/index-1.6.5-sec.html`)
43-
- Click on every button, verifying each vulnerability DOES NOT manifest in the log, e.g. only showing that the CVE reproduction methods were called, but failed to reproduce the issue. Also verify no unexpected errors appear
45+
- Run `nom run serve` in `/security/test`
46+
- Open <http://localhost:3333> in your browser of choice
47+
- Select the jQuery version you are interested in
48+
- All CVEs are reproduced automatically, but you can trigger them again by clicking their respective buttons
49+
- Check the `Patched` checkbox to load the patched version of the jQuery version you selected
50+
- An attempt is made to trigger all CVEs automatically, but you can attempt to trigger them again by clicking their respective buttons
4451
- Rejoice!

β€Žsecurity/server/index.cjsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ app.use(express.static('../site'));
2222

2323
app.listen(port, () => {
2424
console.log(`listening on port ${port} (test site)`);
25+
console.log('\nopen http://localhost:3333 in your browser if you want to test manually');
2526
});
26-

β€Žsecurity/test/package.jsonβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"private": true,
33
"scripts": {
4+
"//": "run server for manual testing",
5+
"serve": "node ../server/index.cjs",
46
"//": "use node test runner",
57
"node": "npm test node",
68
"//": "use tap test runner",

0 commit comments

Comments
Β (0)