E2E Testing

Learn how to set up E2E testing in your Nuxt Starter Kit application.

This starter kit uses Playwright for end-to-end (E2E) testing. Playwright is a powerful and flexible testing framework that allows you to automate browser interactions and test your web applications across different browsers and devices.

In app/e2e directory, you will find the following files:

  • page: This directory contains the page objects for your application. Page objects are a design pattern that helps you organize your test code by encapsulating the interactions with different pages of your application. Each page object should represent a specific page or component of your application and provide methods to interact with it.
  • /: The root directory contains your E2E test files. You can create separate test files for different features or pages of your application. Each test file should follow the naming convention *.e2e.ts to be recognized by Playwright.
The E2E tests are very basic and only check if the application is running. You can extend them to cover more complex scenarios and interactions as needed.

Running E2E Tests

You can run the E2E tests using the following command:

pnpm test:e2e

This command will execute all the E2E tests in your application and generate a report with the results.

The following command will run the E2E tests with the Playwright UI to visualize the test execution:

pnpm test:e2e:ui

Continous Integration (CI)

The E2E tests are automatically run in the CI pipeline when you push changes to your repository. This ensures that your application is always tested and verified before being deployed to production.

You can find the configuration for the CI pipeline in the .github/workflows/nuxthub.yml file.