protractor-e2e-coverage

1.3.0 • Public • Published

Protractor e2e coverage

A plugin for Protractor to measure e2e coverage

Install

npm install protractor-e2e-coverage

Usage

in your protractor conf file add this:

  plugins: [
    {
      path: '../node_modules/protractor-e2e-coverage/index.js',
      outdir: 'test/coverage'
    }
  ],

Options

coverage setup comes predefined with what elements and events to listen to and report. it's possible to set this up with the following command

  plugins: [
	{
      elements: [ 
      	// add one for each DOM type
        {
          'type': 'button',
          'events': ['click'], // array of events to listen to
          'elements': []
        }
      ]
  }

Current DOM element and event setup

Elements Events
Button - Click - - - - -
Form - - - - - - Submit
Input Input Click Invalid Focus Blur Change -
Select - Click - - - Change -
Textarea Input Click - Focus Blur Change -
A - Click - Focus Blur - -

What it is

Runs after your tests to see which elements on the page has been interacted with. If coverage in unit is measuring visited logic, then this can be seen as visited elements.

What the user sees, the user should be able to interact with

It essentially detects events on certain elements

Package Sidebar

Install

npm i protractor-e2e-coverage

Weekly Downloads

31

Version

1.3.0

License

ISC

Last publish

Collaborators

  • markuswaltre