Socket
Socket
Sign inDemoInstall

eslint-plugin-ui-testing

Package Overview
Dependencies
127
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-ui-testing

ESLint rules for UI testing tools WebdriverIO, Cypress, TestCafe, Playwright, Puppeteer


Version published
Weekly downloads
5.5K
decreased by-22.81%
Maintainers
1
Install size
3.58 MB
Created
Weekly downloads
 

Readme

Source

eslint-plugin-ui-testing

Build Status

ESLint plugin that helps following best practices when writing UI tests. It supports the following automation tools (in alphabetical order):

  • Cypress
  • Playwright
  • Puppeteer
  • TestCafe
  • WebdriverIO

Usage

Prerequisite:

  • ESLint is installed (npm i eslint --save-dev)
  1. Install eslint-plugin-ui-testing:
npm i eslint-plugin-ui-testing --save-dev
  1. Add the ui-testing plugin to the .eslintrc configuration file.
{
    "plugins": ["ui-testing"]
}
  1. Configure the rules as follows by using the recommended ruleset per automation tool. Choose one from:
  • plugin:ui-testing/cypress
  • plugin:ui-testing/playwright
  • plugin:ui-testing/puppeteer
  • plugin:ui-testing/testcafe
  • plugin:ui-testing/webdriverio

Example:

{
    "extends": ["plugin:ui-testing/webdriverio"]
}

Customization

You can customize specific rules in the .eslintrc configuration file.

{
    "rules": {
        "ui-testing/no-disabled-tests": "error", // default = warn
        "ui-testing/no-css-page-layout-selector": ["warn", "webdriverio"] // default = error
    }
}
  • In case you are using a recommended ruleset as described in step 3 (under Usage), then these customized rules will override the default.
  • It is also possible to omit the recommended ruleset and just set each rule specifically as above.

Overview rules

RuleDefaultRuleset
missing-assertion-in-testerrorrecommended-badge
no-absolute-urlwarncypress-badge webdriverio-badge
no-assertions-in-hookserrorrecommended-badge
no-browser-commands-in-testswarnplaywright-badge puppeteer-badge webdriverio-badge
no-css-page-layout-selectorerrorcypress-badge playwright-badge puppeteer-badge testcafe-badge webdriverio-badge
no-disabled-testswarnrecommended-badge
no-focused-testswarnrecommended-badge
no-hard-waiterrorcypress-badge playwright-badge puppeteer-badge testcafe-badge webdriverio-badge
no-implicit-waiterrorwebdriverio-badge
no-link-text-selectorerrorwebdriverio-badge
no-tag-name-selectorerrorwebdriverio-badge
no-wait-in-testswarnplaywright-badge puppeteer-badge testcafe-badge webdriverio-badge
no-xpath-page-layout-selectorerrorwebdriverio-badge
no-xpath-selectorwarnwebdriverio-badge

Note: All automation tool specific rulesets include the recommended ruleset.

Keywords

FAQs

Last updated on 28 Mar 2022

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