Giter VIP home page Giter VIP logo

feature-map's Introduction

feature-map

This is a bare bones test coverage feature map library. It will take a yaml file path as an input and calculate the coverage of the features in the file. This is useful for tracking coverage for UI E2E tests.

Installation

npm install feature-map

Usage

JavaScript

const calculateYamlCoverage = require('feature-map');

calculateYamlCoverage('./featureMap.yml');

TypeScript

import {calculateYamlCoverage} from 'feature-map';

calculateYamlCoverage('./test/testCoverage.yml');

Given the following feature map: featureMap.yml. NOTE: it is important to note that page: and features: are required keys. Currently the library does not support keys that differ from features:. Later down the road I could see adding scenarios: or tests: as a key for similar calculations.

- page: '/auth/login'
  features:
    sign in with google: false
    email: true
    password: true
    login: true
    register your account: false
    forgot password: false
- page: '/auth/forgot-password'
  features:
    email: false
    set new password: false
- page: '/auth/register'
  features:
    first name: false
    last name: false
    date of birth: false
    address: false
    postcode: false
    city: false
    state: false
    country: false
    phone rate: false
    e-mail address: false
    password: false
    register button: false
- page: '/category/hand-tools'
  features:
    header: true
    sidebar:
      sort: false
      filters: false
      by brand: false
    product card:
      image: false
      image zoom: false
      title: false
      price: false
    pagination:
      previous: false
      next: false
      number: false
- page: '/product/{id}'
  features:
    header: false
    product details:
      image: false
      title: false
      tags: false
      price: false
      description: false
      quantity: false
      add to cart: false
      add to favorites: false
    related products:
      image: false
      title: false
      more information: false
    footer: false

When adding to your codebase you will get console.log() output like this:

/auth/login page has 50% coverage
/auth/forgot-password page has 0% coverage
/auth/register page has 0% coverage
/category/hand-tools page has 9.09% coverage
/product/{id} page has 0% coverage

Total Product coverage is: 64.79%

This will also generate the same details in a file named coverage-output.txt

feature-map's People

Contributors

bmayhew avatar

Stargazers

Troy Edmison avatar Aleksandar Dobrev avatar Jane avatar Rodrigo Costa avatar Otoniel avatar

Watchers

 avatar Aleksandar Dobrev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.