Giter Site home page Giter Site logo

sekhavati / data-testid-inspector Goto Github PK

View Code? Open in Web Editor NEW
14.0 0.0 0.0 1.38 MB

:mag: See what data-testid's exist in any page, with one click, right from your browser

License: MIT License

JavaScript 100.00%
data-testid automation-testing automation-tests end-to-end-testing e2e-testing e2e-tests automated-tests testing-tools data-testid-inspector test-automation

data-testid-inspector's Introduction

data-testid-inspector

What is this?

A snippet of code you can save as a bookmark that will show what elements in the page have a data-testid attribute.

demo

How do I use it?

  1. Copy the code from index.js to your clipboard
  2. Open a browser that has support for bookmarklets (eg: Chrome)
  3. Create a new bookmark and paste the code into the field you would normally enter a URL
  4. Open any webpage and click the bookmark

Any elements in the page with a data-testid attribute will be highlighted and their ID displayed alongside.

Why would I want this?

Automation testers that write end-to-end tests can often benefit from targeting/interacting with elements in the page via data-testid’s that remain constant instead of relying on the underlying element type or classes etc that are susceptible to change. Doing so ensure the tests they write are less brittle. This tool will help them quickly visualise what is available in any given page and allow them to write tests faster. Developers can also benefit from this visualisation when writing units tests that interact with components they aren't familiar with {…:heart:}

Can I use a different test ID attribute?

Yes. If you use a different attribute name for your test id's you can substitute it here before saving the bookmark

Did this tool help you?

Give the repo a ⭐ to show your support!

data-testid-inspector's People

Contributors

sekhavati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.