End to end testing

End to end testing

While WunderGraph does not provide any end to end testing libraries itself, it does fully support using PlayWright .

Initial setup

Follow the official instructions from PlayWright, which will set up an example test for you.

Configure your PlayWright to start your WunderGraph application by editing playwright.config.ts. Look for webServer and add the following lines:

1
2
3
4
5
6
7
8
webServer: {
/*
Run both your backend (via wunderctl up) and your frontend.
See the example at the bottom for more details.
*/
command: 'npm start',
port: 3000,
},

Run your tests

First, install PlayWright browser engines with:

1
npx -- playwright install --with-deps

And finally start your tests by running:

1
npx -- playwright test

Resources

Was this article helpful to you?
Provide feedback

Edit this page