【发布时间】:2018-03-13 18:18:33
【问题描述】:
我在一个 Angular (v.4) 项目中工作并使用 Protractor 我遇到了这个问题
从终端:
I/launcher - 运行 1 个 WebDriver 实例
I/hosted - 在http://localhost:4444/wd/hub 使用 selenium 服务器 已开始 未找到规格 0.003 秒内完成
I/launcher - 0 个 WebDriver 实例仍在运行 [17:06:38] I/launcher - chrome #01 已通过
它运行快速关闭的浏览器,它不运行(查找)任何规范。
量角器.conf.js:
require('ts-node/register');
var helpers = require('./helpers');
exports.config = {
baseUrl: 'http://localhost:3000/',
// use `npm run e2e`
specs: [
helpers.root('test/e2e/**/**.e2e.ts'),
helpers.root('test/e2e/**/*.e2e.ts')
],
exclude: [],
framework: 'jasmine2',
allScriptsTimeout: 110000,
jasmineNodeOpts: {
showTiming: true,
showColors: true,
isVerbose: false,
includeStackTrace: false,
defaultTimeoutInterval: 400000
},
directConnect: true,
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=800x600"]
}
},
onPrepare: function () {
browser.ignoreSynchronization = true;
},
/**
* Angular 2 configuration
*
* useAllAngular2AppRoots: tells Protractor to wait for any angular2 apps on the page instead of just the one matching
* `rootEl`
*/
useAllAngular2AppRoots: true
};
文件夹结构
-/App
|--/config
|--protractor.conf.js
|--helpers.js
|--(all webpack files)
|--(other stuff)
|--/node_modules
|--/src
|--/test
|--/e2e
|-mytest.e2e.ts
|--/features
|--/mockBackend
|--/pages
|-mypage.page.ts
|--config.js
package.json
"cucumber": "^2",
"cucumber-html-reporter": "^3.0.4",
"cucumber-snippets-tsflow": "^1.0.2",
"cucumber-tsflow": "^2.2.0",
"protractor": "^5.1.2",
"protractor-cucumber-framework": "^3",
"protractor-snapshot": "^1.2.0",
【问题讨论】:
-
是的,无事可做
-
没有伙伴,因为 helpers.root() 解析路径
-
好吧,忘记 helpers.root,它不起作用。先打好基础。你是在告诉我硬编码
../test/e2e/**/*.e2e.ts没有helpers.root不起作用?? -
是的,无事可做
-
抱歉,我看错了文件夹结构。
e2e下没有目录,和../test/e2e/*.e2e.ts有什么区别?删除上面的 cmets 以便为这些腾出空间
标签: angular jasmine protractor angular-e2e