Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

protractor-junit-xml-plugin

Package Overview
Dependencies
Maintainers
8
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protractor-junit-xml-plugin

A Protracotor plugin. Report results in junit xml format including requirement ids if available.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
290
increased by121.37%
Maintainers
8
Weekly downloads
 
Created
Source

protractor-junit-xml-plugin

NPM js-standard-style

Description: This plugin is a protractor reporter plugin that reports the test results in JUnit XML file so if you are looking for a plugin to export JUnit XML results you are at the right place. This plugin also has an additional option to parse and extract Xray Id (A JIRA plugin to identify requirements) from a test name and put it in a separate attribute in the output exported XML. This can help in exporting test results with xrayId and link the test to a requirement in Xray Jira (Continuous Integration). It also has an option to just use tests with an xrayId and ignore the tests that don't have an XrayId. By default these additional options are turned off. Please see the configuration section for the option details

  • Technology stack: This is a protractor plugin written in Javascript. It is a node module and can be imported using npm
  • Status: This is the first functional version of this plugin. We are planning to add a change log starting from the next version

Dependencies

This plugin is dependent on the node modules "xmlbuilder currently 12.0.1" and "xml2js-parser currently v1.1.1"". Although these dependencies should be install automatically when this plugin would be installed using npm

Installation

The easiest way is to keep protractor-junit-xml-plugin as a dependency in your package.json pointing to its current repo

npm install protractor-junit-xml-plugin --save-dev

To update to the latest version

npm update protractor-junit-xml-plugin

Configuration

For an example of a protractor config file for this plugin, please see plugin section of protractor.conf.js located in the tests folder of this plugin

The following are the configurable options

outdir: output directory of the test results, if not specified it defaults the directory name to "_test-reports"

filename: the filename starting of output result file, if not specified it defaults the file name to "test-results.xml" 

parseXrayId: If set to true it will try to extract Xray Jira id from the test name and put it in the attribute "requirement" in testcase result xml. The id should be in between two colons e.g ":XRAY-1234: test to check report graphs". The result testcase element would be like <testcase name="Failing test with xrayId" ... requirements="XRAY-1234">. This is helpful if this tet is attached to a jira requirement and you want to report back the result(Continuous Integration). 
if not specified it defaults to "false"

xrayIdOnlyTests: If set to true, it will only consider the tests that have Xray Jira Id in their name. If not specified it defaults to "false"

Usage

After setting the plugin config in the protractor config file (usually named as protractor.conf.js). This plugin would run everytime you run the tests. It will generate the junit output xml in the specified output directory. For each browser there will be a seapate junit out xml file. For e.g if we have set two browsers in our protractor config lets say firefox and chrome and we gave filename option in plugin cofig as e2e-tests then the file names will be

  • chrome-e2e-tests.xml
  • firefox-e2e-tests.xml

If the result file already exist then the plugin will not overwrite it but it will append the current test results in a new testsuite element with a timestamp

How to test the software

This module includes a tests folder that contains a simple node test app and end to end(e2e) tests of the plugin. The e2e tests are in protractor. To run the tests

  1. Firstly, install all the dependencies by npm install.
  2. Install protractor as a global dependency npm i -g protractor
  3. Start the node test app node tests/testapp/server.js (tested on node v10).
  4. Run the tests protractor tests/protractor.conf.js

Known issues

We are actively using this plugin for our protractor e2e tests and have not seen any issues so for. Please contact us if you run into any issues.

Contact / Getting help

You can contact any of us if you run into any issues

License

MIT License

Credits and references

We needed a protractor plugin to export our test results to a JUnit XML file with XRay Ids so we wrote this plugin. We have tried to make it general with the configurable options so that it can be as useful as possible. We thank you to "Philips Health Solutions" in general to give us opportunity to write this plugin. We are also very thankful to Ryan Gatto for his positive and supportive efforts all along.

Keywords

FAQs

Package last updated on 11 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc