Socket
Socket
Sign inDemoInstall

data-qa-report

Package Overview
Dependencies
20
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    data-qa-report

Build a report on the use or not use of the data-qa attributes in the code


Version published
Weekly downloads
36
decreased by-5.26%
Maintainers
1
Install size
2.89 MB
Created
Weekly downloads
 

Readme

Source

data-qa-report

data-qa attribute reporting tool.

The idea is to allow the team to quickly highlight elements with data-qa attributes and those without. Where in the code the items code can be found and ultimately where on your website or app the element can be found.

The output will be written to disk or if no input passed it will log to the console.

The report format is IFinalReport found in, types/index.ts, but see further below for an example JSON output.

What the script does:

  • Reads all html files in a target folder
  • For each file it will find all the data-qa attributes on the elements that match the given CSS Selectors
  • Bundle the output into a single JSON file to read

Todo list for this tool:

See: https://github.com/j-d-carmichael/data-qa-report/issues

The example

In the project on github you will see in the package json a script that runs the tool that would be run when you install from npm like: data-qa-report --input ./test/code-to-report-on --output ./test/report-output --css-selector 'APP-LT-BUTTON'

It will:

  • Read all the html files within: test/code-to-report-on
  • Output the JSON report to the folder: ./test/report-output
  • It will report on elements: APP-LT-BUTTON

The output from the test file results in:

{
  "filesReport": [
    {
      "ext": "html",
      "absolutePath": "/mnt/linuxdrive/code/opensource/data-qa-report/test/code-to-report-on/login.page.html",
      "relativePath": "/test/code-to-report-on/login.page.html",
      "resultsWithDataQa": [
        {
          "dataQaValue": "login-form-submit",
          "nodeName": "APP-LT-BUTTON",
          "xpath": "ION-CONTENT > ION-GRID > ION-ROW > ION-COL > FORM > APP-LT-BUTTON.button-login"
        },
        {
          "dataQaValue": "forgot-password-cancel-button",
          "nodeName": "APP-LT-BUTTON",
          "xpath": "ION-CONTENT > ION-GRID > ION-ROW > ION-COL > FORM > DIV > APP-LT-BUTTON"
        },
        {
          "dataQaValue": "forgot-password-form-submit",
          "nodeName": "APP-LT-BUTTON",
          "xpath": "ION-CONTENT > ION-GRID > ION-ROW > ION-COL > FORM > DIV > APP-LT-BUTTON"
        }
      ],
      "resultsWithoutDataQa": [
        {
          "nodeName": "APP-LT-BUTTON",
          "xpath": "ION-CONTENT > ION-GRID > ION-ROW > ION-COL > NG-CONTAINER > APP-LT-BUTTON.email-login-button"
        }
      ]
    }
  ],
  "quantities": {
    "withDataQa": 3,
    "withoutDataQa": 1
  },
  "nodeNames": [
    "APP-LT-BUTTON"
  ]
}

Keywords

FAQs

Last updated on 20 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc