填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫Home

ng e2e

建構 Angular 應用,並啟動開發伺服器,然後使用 Protractor 執行端到端測試。

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

ng e2e <project> [options]
      
      ng e2e <project> [options]
    
ng e <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.

引數

引數說明
<project>

要建構的專案名。可以是應用或函式庫。

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

選項

選項說明
--base-url=base-url

Protractor 要連線的 base URL。

Base URL for protractor to connect to.

--configuration=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

--dev-server-target=
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.

--grep=grep

執行名稱與模式匹配的規約,該模式在內部編譯為 RegExp。

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

--help=
true|false|json|JSON

在控制檯顯示關於本命令的幫助資訊。

Shows a help message for this command in the console.

預設值: false

--host=host

要監聽的主機。

Host to listen on.

--invert-grep=true|false

反轉 “grep” 選項指定的選擇。

Invert the selection specified by the 'grep' option.

預設值: false

--port

用來啟動應用伺服器的埠。

The port to use to serve the application.

--prod=true|false

"--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.

--protractor-config=
protractor-config

Protractor 配置檔案的名稱。

The name of the Protractor configuration file.

--specs

覆蓋 Protractor 配置中的規約。

Override specs in the protractor config.

--suite=suite

覆蓋 Protractor 配置中測試套件。

Override suite in the protractor config.

--webdriver-update=true|false

嘗試更新 webdriver。

Try to update webdriver.

預設值: true