← 返回命令列表

Linux command

ng-e2e 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run end-to-end tests

ng e2e

Run e2e tests for a specific project

ng e2e [project-name]

Run e2e tests with a specific configuration

ng e2e --configuration production

Run e2e tests on a specific port

ng e2e --port [4200]

说明

ng e2e builds the application, starts a development server, and runs end-to-end tests against it. The command requires an e2e testing framework builder to be configured in the project's angular.json file. Since Angular CLI 12, no default e2e framework is included. Users must add a testing package such as Cypress, Playwright, or Nightwatch via ng add to provide the e2e builder.

参数

--configuration _name_
Target build configuration.
--port _port_
Port for the development server used during testing.
--dev-server-target _target_
Dev server target to run tests against.
--help
Display help information.

FAQ

What is the ng-e2e command used for?

ng e2e builds the application, starts a development server, and runs end-to-end tests against it. The command requires an e2e testing framework builder to be configured in the project's angular.json file. Since Angular CLI 12, no default e2e framework is included. Users must add a testing package such as Cypress, Playwright, or Nightwatch via ng add to provide the e2e builder.

How do I run a basic ng-e2e example?

Run `ng e2e` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --configuration _name_ do in ng-e2e?

Target build configuration.