当使用ember test
本地运行测试时,我收到下面关于成员项目的错误消息。大部分时间PhantomJS都挂着。
$ ember test
not ok 1 Chrome - error
---
message: >
Error: Browser failed to connect within 30s. testem.js not loaded?
Stderr:
2018-07-13 11:24:43.115 Google Chrome[47537:547312] Errors logged by ksadmin: KSKeyedPersistentStore store directory does not exist. [com.google.UpdateEngine.CommonErrorDomain:501 - '/Library/Google/GoogleSoftwareUpdate/TicketStore' - 'KSKeyedPersistentStore.m:368']
KSPersistentTicketStore failed to load tickets. (productID: com.google.Chrome) [com.google.UpdateEngine.CoreErrorDomain:1051 - '/Library/Google/GoogleSoftwareUpdate/TicketStore/Keystone.ticketstore'] (KSKeyedPersistentStore store directory does not exist. - '/Library/Google/GoogleSoftwareUpdate/TicketStore' [com.google.UpdateEngine.CommonErrorDomain:501])
ksadmin cannot access the ticket store:<KSUpdateError:0x100404060
domain="com.google.UpdateEngine.CoreErrorDomain"
code=1051
userInfo={
function = "-[KSProductKeyedStore(ProtectedMethods) errorForStoreError:productID:message:timeoutMessage:]";
date = 2018-07-13 03:24:43 +0000;
productids = {(
"com.google.Chrome"
)};
filename = "KSProductKeyedStore.m";
line = 102;
NSFilePath = "/Library/Google/GoogleSoftwareUpdate/TicketStore/Keystone.ticketstore";
NSUnderlyingError = <KSError:0x100515350
domain="com.google.UpdateEngine.CommonErrorDomain"
code=501
userInfo={
date = 2018-07-13 03:24:43 +0000;
line = 368;
filename = "KSKeyedPersistentStore.m";
function = "-[KSKeyedPersistentStore(PrivateMethods) validateStorePath]";
NSFilePath = "/Library/Google/GoogleSoftwareUpdate/TicketStore";
NSLocalizedDescription = "KSKeyedPersistentStore store directory does not exist.";
}
>;
NSLocalizedDescription = "KSPersistentTicketStore failed to load tickets.";
}
>
[47537:28675:0713/112447.920274:ERROR:ssl_client_socket_impl.cc(1026)] handshake failed; returned -1, SSL error code 1, net_error -107
[47537:28675:0713/112448.006779:ERROR:ssl_client_socket_impl.cc(1026)] handshake failed; returned -1, SSL error code 1, net_error -107
2018-07-13 11:24:52.494 Google Chrome Helper[47600:548065] Couldn't set selectedTextBackgroundColor from default ()
Log: |
{ type: 'error',
text: 'Error: Browser failed to connect within 30s. testem.js not loaded?' }
{ type: 'error',
text: '2018-07-13 11:24:43.115 Google Chrome[47537:547312] Errors logged by ksadmin: KSKeyedPersistentStore store directory does not exist. [com.google.UpdateEngine.CommonErrorDomain:501 - '/Library/Google/GoogleSoftwareUpdate/TicketStore' - 'KSKeyedPersistentStore.m:368']nKSPersistentTicketStore failed to load tickets. (productID: com.google.Chrome) [com.google.UpdateEngine.CoreErrorDomain:1051 - '/Library/Google/GoogleSoftwareUpdate/TicketStore/Keystone.ticketstore'] (KSKeyedPersistentStore store directory does not exist. - '/Library/Google/GoogleSoftwareUpdate/TicketStore' [com.google.UpdateEngine.CommonErrorDomain:501])nksadmin cannot access the ticket store:<KSUpdateError:0x100404060ntdomain="com.google.UpdateEngine.CoreErrorDomain"ntcode=1051ntuserInfo={nttfunction = "-[KSProductKeyedStore(ProtectedMethods) errorForStoreError:productID:message:timeoutMessage:]";nttdate = 2018-07-13 03:24:43 +0000;nttproductids = {(nttt"com.google.Chrome"ntt)};nttfilename = "KSProductKeyedStore.m";nttline = 102;nttNSFilePath = "/Library/Google/GoogleSoftwareUpdate/TicketStore/Keystone.ticketstore";nttNSUnderlyingError = <KSError:0x100515350ntttdomain="com.google.UpdateEngine.CommonErrorDomain"ntttcode=501ntttuserInfo={nttttdate = 2018-07-13 03:24:43 +0000;nttttline = 368;nttttfilename = "KSKeyedPersistentStore.m";nttttfunction = "-[KSKeyedPersistentStore(PrivateMethods) validateStorePath]";nttttNSFilePath = "/Library/Google/GoogleSoftwareUpdate/TicketStore";nttttNSLocalizedDescription = "KSKeyedPersistentStore store directory does not exist.";nttt}ntt>;nttNSLocalizedDescription = "KSPersistentTicketStore failed to load tickets.";nt}n>n[47537:28675:0713/112447.920274:ERROR:ssl_client_socket_impl.cc(1026)] handshake failed; returned -1, SSL error code 1, net_error -107n[47537:28675:0713/112448.006779:ERROR:ssl_client_socket_impl.cc(1026)] handshake failed; returned -1, SSL error code 1, net_error -107n2018-07-13 11:24:52.494 Google Chrome Helper[47600:548065] Couldn't set selectedTextBackgroundColor from default ()n' }
1..1
# tests 1
# pass 0
# skip 0
# fail 1
Testem finished with non-zero exit code. Tests failed.
testem.js:
/*jshint node:true*/
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"disable_watching": true,
"launch_in_ci": [
"Chrome"
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
]
};
已安装版本:
MacOS Sierra 10.12.6
node: 6.12.2
npm: 5.6.0
ember: 2.12.0
ember-cli: 2.18.2
phantomjs: 2.1.1
以下是我的tests/index.html文件的一部分:
<script src="testem.js" integrity=""></script>
<script src="assets/vendor.js"></script>
<script src="assets/test-support.js"></script>
<script src="assets/myApp.js"></script>
<script src="assets/tests.js"></script>
也尝试使用CCD_ 5,但出现相同错误。所以有人知道如何缩小范围,以及为什么testem没有加载?
对于测试,通常需要在启用远程调试的无头模式下运行chrome。将这些行添加到testem.json应该会有所帮助:
"browser_args": {
"Chrome": [
'--headless',
'--disable-gpu',
'--remote-debugging-port=9222',
'--window-size=1440,900',
]
}
我还建议删除"PhantomJS"行-由于这个问题,phantom可能无法与最近的ember版本一起使用。
用以下设置更改了testem.js。及其工作性能:(
/* eslint-env node */
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: {
mode: 'ci',
args: [
'--disable-gpu',
'--headless',
'--remote-debugging-port=0',
'--window-size=1440,900'
]
}
}
};
如果您已经检查了明显的浏览器设置,但它仍然不起作用:看看您是否正在设置EMBER_ENV=test
。