Skip to content

Run E2E tests on a built site, not on the dev server #809

@adamziel

Description

@adamziel

Currently, all E2E tests run on vite dev server:

		"e2e": {
			"executor": "nx:noop",
			"dependsOn": ["dev", "e2e:cypress"]
		},
		"e2e:cypress": {
			"executor": "@nx/cypress:cypress",
			"options": {
				"cypressConfig": "packages/playground/website/cypress.config.ts",
				"testingType": "e2e",
				"baseUrl": "http://localhost:5400/website-server/",
			}
		}

However, we could:

  • Make the e2e task depend on build to build the production version
  • Run the preview task to serve the production version
  • Set the baseUrl to the URL used by the preview task

Which would run these tests in the same environment as the production site runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions