-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pathBuilder is not getting browser capabilities #4
Comments
+1 |
There probably won't be any good / proper solutions until this is resolved: angular/protractor#1938 |
Same here 👍 |
+1 |
Same issue |
What is the issue that prompted the save filename before making a screenshot to avoid promise trouble commit? pathBuilder worked correctly for me with that change reverted. |
+1 |
- file = opts.pathBuilder(spec, suites);
|
@devmao That didn't work for me, as spec doesn't seem to have that attribute - at least for me. Thanks @NickLargen - undoing those changes fixes it for me, too. |
@michaschwab Which version of protractor are you using? |
another workaround: onPrepare: function() {
browser.getCapabilities().then(function (capabilities) {
browser.capabilities = capabilities;
});
jasmine.getEnv().addReporter(
new HtmlScreenshotReporter({
dest: 'test/results/screenshots',
filename: 'screenshots.html',
pathBuilder: function(currentSpec) {
return browser.capabilities.get('platform') + '/' + browser.capabilities.get('browserName') + '.' + browser.capabilities.get('version') + '/' + currentSpec.fullName;
}
})
);
}, |
+1 |
I've had a look at this and think that this issue may be getting a little confused. Both the original method and @bvarga 's method of getting browser capabilities into the pathBuilder seem to work fine. The problem that the original modification is trying to solve is that sometimes screenshots aren't captured if the failing test is the last spec. This seems to be due to something deeper in the Protractor stack, that fails to wait for the async finish of specDone. After running a few tests I've found that none of the changes here prevent that. Why not go back to the original implementation to restore the browser.capability support, then as a workaround set your last spec to: it('This empty spec is a hack fix for Jasmine Reporters bug.', function() {}); or from the linked thread, add this to a containing suite afterAll(function(done){
process.nextTick(done);
}); |
Can you please share what's the work around with this? Thanks!! |
closed by #29 |
I'm using Protractor 3.1 and the 0.3.0 version of protractor-jasmine-2-screenshot-reporter and still see this problem.
Does anyone know a fix for this? |
pathBuilder in specDone method doesn't get browser capabilities passed to it.
https://github.com/mlison/protractor-jasmine2-screenshot-reporter/blob/master/index.js#L143
(same applies for metadataBuilder)
The text was updated successfully, but these errors were encountered: