作者:小破孩子520 | 来源:互联网 | 2023-08-16 20:05
ImconfrontedwithastrangeerrorwhenexecutingmyE2Etests.Abroadcastedeventisnotconsumed
I'm confronted with a strange error when executing my E2E tests. A broadcasted event is not consumed by one of my directives anymore and therefore a particular view is not rendered correctly.
执行我的E2E测试时,我遇到了一个奇怪的错误。我的某个指令不再使用广播事件,因此无法正确呈现特定视图。
This does not occur only when I run the test alone. And, this does not occur either when I run the test for the first time (singleRun=true) or the first run in debug mode.
仅当我单独运行测试时才会发生这种情况。并且,当我第一次运行测试(singleRun = true)或第一次运行调试模式时,这不会发生。
The implemented event logic itself works fine.
实现的事件逻辑本身工作正常。
What can cause this strange behavior?
什么可以导致这种奇怪的行为?
My set up:
我的设置:
- Karma version: 0.10.10
Karma版本:0.10.10
- Angular version: 1.3.0
角度版本:1.3.0
My Karma Config:
我的Karma配置:
module.exports = function(config) {
config.set({
basePath: '',
files: [
'test/e2e/*.js'
],
singleRun: true,
frameworks: ['ng-scenario', 'jasmine-jquery', 'jasmine'],
browsers: ['Chrome'],
plugins: [
'karma-chrome-launcher',
'karma-jasmine-jquery',
'karma-jasmine',
'karma-junit-reporter',
'karma-ng-scenario'
],
junitReporter: {
outputFile: 'test-result.xml'
},
urlRoot: '/_karma_/',
proxies: {
'/': 'http://localhost:' + (process.env.PORT ? process.env.PORT : '8080') + "/"
},
});
};
Any hints are very much appreciated!
任何提示都非常感谢!
Thanks, Sebastian
1 个解决方案