protractor 2.0 fails with `Cannot read property '_failures' of undefined`
See original GitHub issueI want to use the jasmine-reports with the protractor 2.0, but I’m getting an error:
/Dev/project/node_modules/jasmine-reporters/src/junit_reporter.js:154
if (isFailed(spec)) { spec._suite._failures++; }
^
TypeError: Cannot read property '_failures' of undefined
I checked the ‘spec’ object, it’s like this currently (no _suite
property)
{ id: 'spec0',
description: 'should contain basic identifiers',
fullName: 'episode: TC14235 required fields should contain basic identifiers',
failedExpectations:
[ { matcherName: '',
message: 'Failed: undefined is not a function',
stack: 'Error: Failed: undefined is not a function\n at stack (/Dev/project/node_modules/protractor/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1441:17)\n ...
passed: false,
expected: '',
actual: '' } ],
passedExpectations: [],
status: 'failed',
_endTime: Thu Apr 16 2015 10:42:18 GMT-0400 (EDT) }
May be I’m doing something not supported in the 2.0?
Thanks
Issue Analytics
- State:
- Created 8 years ago
- Comments:27
Top Results From Across the Web
Failed: Cannot read property 'presenceOf' of undefined
I'm trying to wait for element presence using protractor, typescript. Here are my code: import { browser, by, element } from 'protractor' ...
Read more >Failed: Cannot read property 'isPresent' of undefined
This is my test: var elm = productDialogPage.createTaskButton; var EC = protractor.ExpectedConditions; //get count of checked checkboxes, count ...
Read more >unknown error: Cannot read property 'get' of undefined
19:29:18.964 FAIL WebDriverException: Message: unknown error: Cannot read property 'get' of undefined. (Session info: headless chrome=72.0.3626.119).
Read more >angular/protractor - Gitter
so, i have tried all the options to keep js file alive but i was failed, last option i ... TypeError: Cannot read...
Read more >Intermittent test suite failures, TypeError: Cannot read property ...
This error "TypeError: Object #<Sockit> has no method 'setPollTimeout'" is that we have a "bad" binary for sockit.node NodeJS binary module. If you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The solution for this is pretty simple:
onPrepare
should return the promise and so protractor will wait for the promise to resolve before going on to running the tests:Still problem is not resolved. I am using “protractor-jasmine2-html-reporter” with Jasmine2 Framework in conf.js onPrepare: function() { var capsPromise = browser.getProcessedConfig(); capsPromise.then(function(caps){ var browserName = caps.capabilities.browserName.toUpperCase(); var browserVersion = caps.capabilities.browser_version; var platform = process.platform; var prePendStr=browserName+“”+browserVersion+“”+platform; browser.manage().timeouts().pageLoadTimeout(600000), browser.manage().timeouts().implicitlyWait(300000), jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({ savePath: _dirname+'/…/TestOutput/Automation_reports’+timeStamp+‘/’, takeScreenshotsOnlyOnFailures: true, screenshotsFolder: ‘./screenshots’, filePrefix: prePendStr+‘report’ }));}); } getting error: