New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

feature-map

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feature-map

A Tool to manually track the automation coverage progress of features within a project

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-4.4%
Maintainers
1
Weekly downloads
 
Created
Source

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 '../src';

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

Keywords

FAQs

Package last updated on 20 Nov 2023

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