填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

ng e2e

构建 Angular 应用,并启动开发服务器,然后使用 Protractor 运行端到端测试。

Builds and serves an Angular app, then runs end-to-end tests using Protractor.

      
      ng e2e <project> [options]
    
      
      ng e <project> [options]
    

说明

必须从工作空间目录中执行。如果未提供项目名称,它将对所有项目执行。

Must be executed from within a workspace directory. When a project name is not supplied, it will execute for all projects.

参数

参数说明Value Type
<project>

要构建的项目名。可以是应用或库。

The name of the project to build. Can be an application or a library.

string

选项

选项说明Value TypeDefault Value
--base-url

Protractor 要连接的 base URL。

Base URL for protractor to connect to.

string
--configuration

构建器的一个或多个命名配置,是一个逗号分隔的列表,就像在 angular.json 的 "configurations" 部分指定的一样。 构建器使用这些命名配置运行给定的目标。 欲知详情,参见 https://angular.cn/guide/workspace-config#alternate-build-configurations。 可以通过显式指定 "--prod" 标志来覆盖它。

One or more named builder configurations as a comma-separated list as specified in the "configurations" section of angular.json. The builder uses the named configurations to run the given target. For more information, see https://angular.io/guide/workspace-config#alternate-build-configurations. Setting this explicitly overrides the "--prod" flag.

别名: -c

string
--dev-server-target

一个开发服务器构建器目标,用来以 project:target[:configuration] 的格式针对其运行测试。你还可以传入逗号分隔的多个配置名称列表。例如:project:target:production,staging

A dev-server builder target to run tests against in the format of project:target[:configuration]. You can also pass in more than one configuration name as a comma-separated list. Example: project:target:production,staging.

string
--grep

执行名称与模式匹配的规约,该模式在内部编译为 RegExp。

Execute specs whose names match the pattern, which is internally compiled to a RegExp.

string
--help

在控制台显示关于本命令的帮助信息。

Shows a help message for this command in the console.

true|false|json|JSONfalse
--host

要监听的主机。

Host to listen on.

string
--invert-grep

反转 “grep” 选项指定的选择。

Invert the selection specified by the 'grep' option.

booleanfalse
--port

用来启动应用服务器的端口。

The port to use to serve the application.

number
--prod

"--configuration=production" 的简写形式。 把构建配置的目标设置为产品环境。 默认情况下,产品环境目标是在工作空间配置中设置的,可以设置打包方式、摇树优化限制、死代码移除限制等方面。

Shorthand for "--configuration=production". Set the build configuration to the production target. By default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.

boolean
--protractor-config

Protractor 配置文件的名称。

The name of the Protractor configuration file.

string
--specs

覆盖 Protractor 配置中的规约。

Override specs in the protractor config.

array
--suite

覆盖 Protractor 配置中测试套件。

Override suite in the protractor config.

string
--webdriver-update

尝试更新 webdriver。

Try to update webdriver.

booleantrue