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

JUnitXmlReporter report not produced when errors are found #167

Open
RodrigoMattosoSilveira opened this issue Mar 31, 2017 · 2 comments
Open

Comments

@RodrigoMattosoSilveira
Copy link

RodrigoMattosoSilveira commented Mar 31, 2017

Steps to reproduce

  • angular 2
  • angular-cli
  • protractor
  • framework: jasmine2
  • protractor configured as per instructions

Observed Behavior

  • folder and report not created when tests do not pass

Expected behavior

  • folder and report created when tests do not pass.
  • NOTE: folder and report are created when tests pass.

protractor

// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './e2e/**/*.e2e-spec.ts'
  ],
  capabilities: {
    'browserName': 'chrome'
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine2',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
  useAllAngular2AppRoots: true,
  beforeLaunch: function() {
    require('ts-node').register({
      project: 'e2e'
    });
  },
  onPrepare() {
        let specReporter = require('jasmine-spec-reporter').SpecReporter;
        jasmine.getEnv().addReporter(new SpecReporter({
            spec: { displayStacktrace: true }
        }));

        let jasmineReporters = require('jasmine-reporters');
        jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
            consolidateAll: true,
            savePath: 'test_results_integration',
            filePrefix: 'xmloutput'
        }));
  }
};

Output

$ ng e2e
** NG Live Development Server is running on http://localhost:49153 **
Hash: f625d81f6b1139d09307
Time: 15617ms
chunk {0} main.bundle.js, main.bundle.js.map (main) 98.7 kB {3} [initial] [rendered]
chunk {1} styles.bundle.js, styles.bundle.js.map (styles) 434 kB {4} [initial] [rendered]
chunk {2} scripts.bundle.js, scripts.bundle.js.map (scripts) 669 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.01 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
[13:03:30] I/update - chromedriver: file exists /Users/silveir/Projects/dlabs/ng2-client/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.28.zip
[13:03:30] I/update - chromedriver: unzipping chromedriver_2.28.zip
[13:03:30] I/update - chromedriver: setting permissions to 0755 for /Users/silveir/Projects/dlabs/ng2-client/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.28
[13:03:30] I/update - chromedriver: chromedriver_2.28 up to date
[13:03:30] I/launcher - Running 1 instances of WebDriver
[13:03:30] I/direct - Using ChromeDriver directly...
[13:03:33] E/launcher - No element found using locator: By(css selector, *[id="TenantAdminLink"])
[13:03:33] E/launcher - NoSuchElementError: No element found using locator: By(css selector, *[id="TenantAdminLink"])
at WebDriverError (/Users/silveir/Projects/dlabs/ng2-client/node_modules/selenium-webdriver/lib/error.js:27:5)
at NoSuchElementError (/Users/silveir/Projects/dlabs/ng2-client/node_modules/selenium-webdriver/lib/error.js:168:5)
at elementArrayFinder.getWebElements.then (/Users/silveir/Projects/dlabs/ng2-client/node_modules/protractor/lib/element.ts:851:17)
at ManagedPromise.invokeCallback_ (/Users/silveir/Projects/dlabs/ng2-client/node_modules/selenium-webdriver/lib/promise.js:1366:14)
at TaskQueue.execute_ (/Users/silveir/Projects/dlabs/ng2-client/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/Users/silveir/Projects/dlabs/ng2-client/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/Users/silveir/Projects/dlabs/ng2-client/node_modules/selenium-webdriver/lib/promise.js:2813:27)
at /Users/silveir/Projects/dlabs/ng2-client/node_modules/selenium-webdriver/lib/promise.js:676:7
at process.tickCallback (internal/process/next_tick.js:103:7)Error
at ElementArrayFinder.applyAction
(/Users/silveir/Projects/dlabs/ng2-client/node_modules/protractor/lib/element.ts:482:23)
at ElementArrayFinder.(anonymous function) [as click] (/Users/silveir/Projects/dlabs/ng2-client/node_modules/protractor/lib/element.ts:96:21)
at ElementFinder.(anonymous function) [as click] (/Users/silveir/Projects/dlabs/ng2-client/node_modules/protractor/lib/element.ts:873:14)
at Function.TenantPage.navigateToTenantView (/Users/silveir/Projects/dlabs/ng2-client/e2e/tenant.po.ts:89:42)
at Suite. (/Users/silveir/Projects/dlabs/ng2-client/e2e/tenant.e2e-spec.ts:19:16)
at addSpecsToSuite (/Users/silveir/Projects/dlabs/ng2-client/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:867:25)
at Env.describe (/Users/silveir/Projects/dlabs/ng2-client/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:836:7)
at describe (/Users/silveir/Projects/dlabs/ng2-client/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:3576:18)
at Suite. (/Users/silveir/Projects/dlabs/ng2-client/e2e/tenant.e2e-spec.ts:17:3)
at addSpecsToSuite (/Users/silveir/Projects/dlabs/ng2-client/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:867:25)
at Env.describe (/Users/silveir/Projects/dlabs/ng2-client/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:836:7)
at describe (/Users/silveir/Projects/dlabs/ng2-client/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:3576:18)
at Object. (/Users/silveir/Projects/dlabs/ng2-client/e2e/tenant.e2e-spec.ts:5:1)
at Module._compile (module.js:570:32)
at Module.m._compile (/Users/silveir/Projects/dlabs/ng2-client/node_modules/ts-node/src/index.ts:406:23)
at Module._extensions..js (module.js:579:10)

@jkieley
Copy link

jkieley commented Sep 3, 2018

+1

@intellix
Copy link

Getting this massively. Has anyone found any sort of workaround or alternatives?

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

3 participants