Running the app
Summary
- Introduce to the Epic Stack app, briefly.
- Changes in
playwright.config.ts, mainly: PORTat which the app will be running.use.baseURLto we can use relative URLs in our tests.- The
webServeroption to spawn our app and wait at the givenPORT. reuseExistingServerallows us to use an already running app locally for faster tests.testDirset to./tests/e2esince our app now also has other types of tests.
- New test at
tests/e2e/homepage.test.ts. We need to test our app, not runningepicweb.dev. - The basic structure of the test remains the same though:
- Visit the homepage
/(since we enabled relative URLs). - Assert that the heading text is visible to the user.
- Verify the test via
npm run test:e2e.