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

Screenshot fileName has a period in the name when test suite is nested within another #26

Open
JaxxAnik opened this issue May 23, 2018 · 4 comments

Comments

@JaxxAnik
Copy link

Steps:
-Write a sample test and nest one describe within the other
-Write the nested test so it fails
EG:

describe('Suite1', () => {
  it('Random sample test', () => {
    expect(element(by.binding('latest')).getText()).toEqual('5');
  });
  describe('Suite2', () => {
    it('should fail', () => {
      expect(true).toBe(false);
    });
  });
});

In the test report, the suite name reads as "Suite1.Suite2". And the screenshot file reference is: ./screenshots/chrome-Suite1.Suite2 should fail.png. How can I stop the xml report being created from being produced without using a period in the name? Because this is what the xml report looks like:
<testcase classname="Suite1.Suite2" name="should fail" time="0.181">.
Thanks!

@JaxxAnik
Copy link
Author

Worked around this by changing the generated test suite name like so:

jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
      consolidateAll: true,
      savePath: './reports/',
      filePrefix: 'xmlresults',
      modifySuiteName: function(generatedSuiteName, suite) {
        return generatedSuiteName.replace('.',' ');}
    }));

Note: I'm also using jasmine-reporters to write my test report into xml report

@azachar
Copy link

azachar commented May 25, 2018

Hello @JaxxAnik, use my fork of this repo (https://github.com/azachar/protractor-screenshoter-plugin) that handle files differently and has no issues like this one. Also, it creates nicer reports and comes with more tested features :)

@JaxxAnik
Copy link
Author

Thank you @azachar.I like your reporter. Question for you: If I shard the tests, let's say only on chrome, the report will still be consolidated into one HTML report, right?

@azachar
Copy link

azachar commented Jun 1, 2018 via email

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

2 participants