我正在使用 Jasmine JUnit Reports 的修改版本(可在此处找到:https ://github.com/angular/protractor-cookbook/tree/master/jasmine-junit-reports )并且收到错误消息RangeError: Maximum call stack size exceeded
我修改报告的原因是我需要suiteDone
步骤生成的 xml 报告,而不是jasmineDone
步骤。所以基本上我将所有代码从jasmineDone
函数中移出suiteDone
,这导致了我看到的错误。我对 js 比较陌生,所以不确定是否有一些异步问题或类似的问题。
这是堆栈跟踪和相关的代码位:
- RangeError: Maximum call stack size exceeded
at getSuite (C:\Users\AutomationUser\application\admin\adminui\e2e\common-pages\reporter.js:248:26)
at exportObject.QmetryReporter.self.suiteDone (C:\Users\AutomationUser\application\admin\adminui\e2e\common-pages\reporter.js:312:21)
at exportObject.QmetryReporter.self.suiteDone (C:\Users\AutomationUser\application\admin\adminui\e2e\common-pages\reporter.js:322:22)
getSuite
功能(第 248 行):
function getSuite(suite) {
__suites[suite.id] = extend(__suites[suite.id] || {}, suite);
return __suites[suite.id];
}
功能块suiteDone
:
self.suiteDone = function (suite) {
suite = getSuite(suite); // this is line 312 from stacktrace
if (suite._parent === UNDEFINED) {
// disabled suite (xdescribe) -- suiteStarted was never called
self.suiteStarted(suite);
}
suite._endTime = new Date();
currentSuite = suite._parent;
// below this line is the start of jasmineDone function that I moved into this function
if (currentSuite) {
// focused spec (fit) -- suiteDone was never called
self.suiteDone(fakeFocusedSuite); // this is line 322 from stacktrace
}
该问题似乎仅在运行更大的测试规范分组时发生。如果只运行一个测试文件,我不会遇到问题。