Skip to content

Commit 93ae8ac

Browse files
committed
Add a section on testing the examples. Also introduce the local examples/
1 parent 824bee4 commit 93ae8ac

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ p5.sound.js extends the musical and sonic capabilities of [p5.js](https://p5js.o
44

55
## Examples
66

7-
- p5.sound example on p5.js editor [here](https://editor.p5js.org/thomasjohnmartinez/collections/Dp0zGclVL)
7+
- A set of p5.sound examples are in this repo at [examples/](examples/)
8+
- The original examples can be found on the p5.js web editor [here](https://editor.p5js.org/thomasjohnmartinez/collections/Dp0zGclVL). Note that these may differ from the above set.
89
- Legacy p5.js Sound Tutorial by Dan Shiffman on [YouTube](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6aFcVjlDAkkGIixw70s7jpW)
910

1011
## Documentation
@@ -76,3 +77,32 @@ building reference pages (optional)
7677
```
7778
npx yuidoc .
7879
```
80+
81+
## Testing the examples
82+
83+
The library is configured to use [Playwright](https://playwright.dev/) to automatically test the [local](./examples) and [web-editor-hosted](https://editor.p5js.org/thomasjohnmartinez/collections/Dp0zGclVL) sets of p5.sound.js examples by automatically controlling a browser (firefox or chromium).
84+
85+
If you haven't used Playwright on your system before, you'll have to run the following command _once_ to allow it to download the browsers it uses:
86+
87+
### Setting up playwright
88+
```bash
89+
npx playwright install
90+
```
91+
92+
### Starting the tests
93+
1. Launch playwright's test-runner UI:
94+
```bash
95+
npm run test:integration:ui
96+
```
97+
98+
2. Choose example set(s) and browser(s)
99+
From the GUI, click "projects" and choose which examples ("web-" and/or "local-") and which browsers ("chromium" and/or "firefox") you wish to test.
100+
101+
3. Run the tests!
102+
click the green play button at the top of the list of tests.
103+
104+
If a test fails, you can inspect its console log, the test actions, and even screenshots of what it looked like while it was running.
105+
106+
There are also various other ways to run the tests automatically without any interaction.
107+
108+
For more information, read [tests/integration/about-these-tests.md](tests/integration/about-these-tests.md)

0 commit comments

Comments
 (0)