ng e2e <project> [options] ng e <project> [options]
参数和语法 | 描述 |
<project> | 要测试的项目名称。 |
选项和语法 | 描述 |
--baseUrl=baseUrl | 量角器要连接的基本 URL。 |
--configuration=configuration |
一个命名的构建目标,在 angular.json 的"配置"部分中指定。每个命名的目标都伴随着该目标的选项默认配置。明确设置此项会覆盖"--prod"标志
别名:-c
|
--devServerTarget=devServerTarget | 用于运行测试的开发服务器目标。 |
--grep=grep | 执行名称与模式匹配的规范,该规范在内部编译为 RegExp。 |
--help=true|false|json|JSON |
在控制台中显示此命令的帮助消息。
默认值:false
|
--host=host | 主持人收听。 |
--invertGrep=true|false |
反转'grep'选项指定的选择。
默认值:false
|
--port | 用于为应用程序提供服务的端口。 |
--prod=true|false | "--configuration=production"的简写。当为 true 时,将构建配置设置为生产目标。默认情况下,生产目标是在工作区配置中设置的,以便所有构建都使用捆绑、有限的 tree-shaking 和有限的死代码消除。 |
--protractorConfig=protractorConfig | 量角器配置文件的名称。 |
--specs | 覆盖量角器配置中的规范。 |
--suite=suite | 覆盖量角器配置中的套件。 |
--webdriverUpdate=true|false |
尝试更新网络驱动程序。
默认:true
|
\>Node\>Lidihuo> ng e2e ... chunk {main} main.js, main.js.map (main) 14.3 kB [initial] [rendered] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 141 kB [initial] [rendered] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered] chunk {styles} styles.js, styles.js.map (styles) 12.4 kB [initial] [rendered] chunk {vendor} vendor.js, vendor.js.map (vendor) 3 MB [initial] [rendered] Date: 2020-06-06T04:20:15.029Z-Hash: 16f321e3d4599af26622-Time: 20899ms ** Angular Live Development Server is listening on localhost:4200, open your bro wser on http://localhost:4200/ ** : Compiled successfully. ... workspace-project App x should display welcome message -Failed: No element found using locator: By(css selector, app-root .content span) ... From: Task: Run it("should display welcome message") in control flow ... ************************************************** * Failures * ************************************************** 1) workspace-project App should display welcome message -Failed: No element found using locator: By(css selector, app-root .content span) Executed 1 of 1 spec (1 FAILED) in 2 secs.
<div class="content" role="main"> <span>{{ title }} app is running!</span> </div> <app-goals></app-goals> <router-outlet></router-outlet>
\>Node\>Lidihuo> ng e2e ... chunk {main} main.js, main.js.map (main) 14.9 kB [initial] [rendered] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 141 kB [initial] [rendered] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered] chunk {styles} styles.js, styles.js.map (styles) 12.4 kB [initial] [rendered] chunk {vendor} vendor.js, vendor.js.map (vendor) 3 MB [initial] [rendered] Date: 2020-06-06T04:28:33.514Z-Hash: 5d8bf2fc7ff59fa390b0-Time: 10529ms ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** : Compiled successfully. ... workspace-project App √ should display welcome message Executed 1 of 1 spec SUCCESS in 2 secs.