Skip to content
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

Only report from last session is available with multiCapabilities and maxSessions = 1 #47

Open
ovk opened this issue Jan 29, 2015 · 9 comments

Comments

@ovk
Copy link

ovk commented Jan 29, 2015

Example Protractor config:

exports.config =
{
   ....

maxSessions: 1,

multiCapabilities: [
{
    browserName: 'chrome'
},
{
    browserName: 'firefox'
},
{
    browserName: 'safari'
},
{
    'browserName': 'internet explorer',
    'platform': 'ANY',
    'version': '11'
} ],

onPrepare: function() {
        jasmine.getEnv().addReporter(new HtmlReporter(
        {
            baseDirectory: 'report',
            takeScreenShotsOnlyForFailedSpecs: true,
            docTitle: 'Web UI Test Report'
        }));
}
  ....
}

Parameter maxSessions: 1 forces Protractor to execute tests in different browsers in sequence, rather than in parallel. However, in HTML report only results from the last run are available (in this case - from the Internet Explorer).

I believe results should be accumulated in the same way how it would be with maxSessions: -1

@mulyoved
Copy link

Maybe pathBuilder from the README will help by write the reports to different path

new HtmlReporter({
   baseDirectory: '/tmp/screenshots'
   , pathBuilder: function pathBuilder(spec, descriptions, results, capabilities) {
      // Return '<browser>/<specname>' as path for screenshots:
      // Example: 'firefox/list-should work'.
      return path.join(capabilities.caps_.browser, descriptions.join('-'));
   }
});

@ovk
Copy link
Author

ovk commented Feb 26, 2015

Hi @mulyoved! Unfortunately, this doesn't help. First of all, it seems like the reports directory is cleaned on each run, so even with path builder only last report is available. And secondly, with this approach there will be separate HTML reports for each browser, but not the single HTML report which contains results from all browsers.

@gssatcc
Copy link

gssatcc commented Oct 13, 2015

Do you have consolidate and consolidateAll set to true?

@ovk
Copy link
Author

ovk commented Oct 14, 2015

No I don't. What are these options? There are nothing about them in readme.

@gssatcc
Copy link

gssatcc commented Oct 15, 2015

They are related to jasmine reporters but I think we have something in common here. I have noticed same behavior as you described but when using shredTestFiles. Did you try preserveDirectory: true ?

@ovk
Copy link
Author

ovk commented Oct 15, 2015

I tried preserveDirectory but it didn't help. I'll try to set consolidate and consolidateAll to true when I get to it.

@sakshinagpal
Copy link

I have also used shardTestFiles in my project and facing the same problem. Is there any workaround to get all the specs result in a single file.

@gssatcc
Copy link

gssatcc commented Oct 16, 2015

@ovk
Copy link
Author

ovk commented Oct 20, 2015

I did retest and it looks like consolidate and consolidateAll options has no effect.

However, it turned out that preserveDirectory: true can be used as a workaround for this issue. Since it adds current test results to the results already existing in the reports folder, all I need to do is to manually clean reports folder before each test run. Thus I'll have the results from all browsers in my reports.html file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants