Giter VIP home page Giter VIP logo

vscode-test-id-generator's Introduction

Test ID Generator

Test ID Generator

Overview

The Test ID Generator is a Visual Studio Code extension designed to simplify the process of adding test identifiers (data-test attributes) to HTML elements in web development projects. If your codebase lacks test IDs and you find yourself spending valuable time manually adding them, this extension is here to be your time-saving ally.

Key Features

  • Effortlessly assign test IDs to HTML elements with a simple keyboard shortcut.
  • Customize the test ID attribute keyword via a user-configurable .testidrc.json file.
  • Intelligent generation of test IDs from existing element IDs for a seamless testing experience.
  • Support for various file types, including HTML, Vue, and JSX.

Demo Preview

Getting Started

Installation

Via Visual Studio Code

Launch Quick Open:

Paste the following command and press Enter.:

ext install test-id-generator

Usage

By default Shift + Alt + T (Cmd + Shift + T for Mac) key combination inserts test id to all the html elements.

It checks the element for the id first. If the element has it, it copies it to the test id. If the element has not, it generates the test id by adding elementName to the defaultTestId from the config.

The attributeKeyword is for test id attribute (data-test, data-test-id, test-id ...)

The ignoreElements is for not adding test id to all the html elements. (<template>, <script>, <style> ...)

Config

// .testidrc.json
{
  "attributeKeyword": "data-test-id",
  "ignoreElements": [
    "template",
    "script",
    "style",
    "body",
    "head",
    "html",
    "header",
    "footer",
    "meta",
    "title",
    "link"
  ],
  "defaultTestId": "test"
}

Contribution

I believe in the power of collaboration! This project is open to contributions from the community. If you're passionate about testing in web development and want to contribute, check out the project on GitHub, and let's build something amazing together! ๐Ÿคโœจ

License

This project is licensed under the MIT License.

vscode-test-id-generator's People

Contributors

omeerdvrn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

haniouredu

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.