How to use the jasmine-reporters.JUnitXmlReporter function in jasmine-reporters

To help you get started, we’ve selected a few jasmine-reporters examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github testing-angular-applications / testing-angular-applications / chapter10 / test_plugins / protractor-onprepare-plugin.conf.js View on Github external
onPrepare: () => {
    let jasmineReporters = require('jasmine-reporters');
    let junitReporter = new jasmineReporters.JUnitXmlReporter({

      // setup the output path for the junit reports
      savePath: 'output/',

      // conslidate all true:
      //   output/junitresults.xml
      //
      // conslidate all set to false:
      //   output/junitresults-example1.xml
      //   output/junitresults-example2.xml
      consolidateAll: false
    });
    jasmine.getEnv().addReporter(junitReporter);

    require('ts-node').register({
      project: 'e2e'
github onury / grunt-jasmine-nodejs / tasks / jasmine.task.js View on Github external
try {
                reporter = jasmineRunner.addReporter(reporter, onComplete);
                enabledReporters.push(reporter.name);
            } catch (error) {
                grunt.log.error(error);
            }
        }

        // BUILT-IN REPORTERS
        // additional Jasmine reporters
        // https://github.com/larrymyers/jasmine-reporters
        var reporter;

        // Reporters that only write to a file:
        if (ropts.junit) {
            reporter = new reporters.JUnitXmlReporter(ropts.junit);
            reporter.name = 'JUnit XML Reporter';
            addReporter(reporter);
        }
        if (ropts.nunit) {
            reporter = new reporters.NUnitXmlReporter(ropts.nunit);
            reporter.name = 'NUnit XML Reporter';
            addReporter(reporter);
        }

        // We will not allow reporters producing command-line output to run at
        // the same time, to prevent puzzled outputs.
        var conflict = Boolean(ropts.console);
        if (!conflict && ropts.terminal) {
            conflict = true;
            reporter = new reporters.TerminalReporter(ropts.terminal);
            reporter.name = 'Terminal Reporter';
github bkimminich / juice-shop / protractor.conf.js View on Github external
onPrepare: function () {
    const jasmineReporters = require('jasmine-reporters')
    jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
      consolidateAll: true,
      savePath: 'build/reports/e2e_results'
    }))

    // Get all banners out of the way
    browser.get('/#')
    const expiry = new Date()
    expiry.setFullYear(expiry.getFullYear() + 1)
    browser.manage().addCookie({ name: 'cookieconsent_status', value: 'dismiss', expiry })
    browser.manage().addCookie({ name: 'welcomebanner_status', value: 'dismiss', expiry })

    // Ensure score board shows all challenges (by default only 1-star challenges are shown)
    browser.get('/#/score-board')
    element(by.id('btnToggleAllDifficulties')).click()
  }
}
github hypery2k / nativescript-urlhandler / test / spec / run.js View on Github external
import Jasmine from 'jasmine';
import jasmineReporters from 'jasmine-reporters';
var jasmine = new Jasmine();
var junitReporter = new jasmineReporters.JUnitXmlReporter({
    savePath: 'target/junit-report',
    consolidateAll: false
});
jasmine.loadConfigFile('test/spec/support/jasmine.json');
jasmine.addReporter(junitReporter);
jasmine.execute();
github gbif / portal16 / spec / unit-server.js View on Github external
jasmine = new Jasmine(),
    SpecReporter = require('jasmine-spec-reporter'),
    jasmineReporters = require('jasmine-reporters');

jasmine.loadConfigFile('spec/support/jasmine_server.json');

jasmine.onComplete(function(passed) {
    if (passed) {
        console.log('All specs have passed');
    } else {
        console.log('At least one spec has failed');
    }
});

jasmine.addReporter(new SpecReporter());
jasmine.addReporter(new jasmineReporters.JUnitXmlReporter({
    savePath: './reports/',
    filePrefix: 'server'
}));


jasmine.execute();
github marklogic / marklogic-data-hub / quick-start / protractor.conf.js View on Github external
onPrepare: function() {
    require('ts-node').register({
      project: 'e2e/tsconfig.e2e.json'
    });

    //HTML report
    jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
      //takeScreenshots: true,
      //takeScreenshotsOnlyOnFailures: true,
      //fixedScreenshotName: true,
      consolidateAll: true,
      savePath: './e2e/reports/',
      filePrefix: 'html-report'
    }));

    jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
      consolidateAll: true,
      savePath: './e2e/reports',
      filePrefix: 'xmlresults'
    }))

    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
  },
github DeForce / LalkaChat / src / themes / default / setup.js View on Github external
const reporters = require('jasmine-reporters');
const path = require('path');

const savePath = path.resolve(__dirname, '..', '..', '..', 'results', 'javascript-tests');

const reporter = new reporters.JUnitXmlReporter({ savePath: savePath, consolidateAll: false, filePrefix: 'javascript-' });

jasmine
    .getEnv()
    .addReporter(reporter);
github finos / plexus-interop / web / packages / common-api-impl / setup-jasmine.js View on Github external
* SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const reporters = require('jasmine-reporters');
const reporter = new reporters.JUnitXmlReporter({
    consolidateAll: false,
    filePrefix: 'jest-junit-result-',
    savePath: __dirname + '/target/surefire-reports/',
});
jasmine.getEnv().addReporter(reporter);
github scenarioo / scenarioo / scenarioo-client / prepareProtractor.js View on Github external
function setupJasmineXmlReporters() {
        jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
            consolidateAll: true,
            savePath: './test-reports',
            filePrefix: 'xmloutput'
        }));
    }
github nicky-lenaers / ngx-scroll-to / protractor.conf.js View on Github external
onPrepare() {
    require('ts-node').register({
      project: 'e2e/tsconfig.e2e.json'
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
    jasmine.getEnv().addReporter(new JasmineReporters.JUnitXmlReporter({
      consolidateAll: false,
      savePath: './reports/e2e',
      filePrefix: '',
      modifyReportFileName: (generatedFileName, suite) => 'test-results'
    }));
  }
};