Skip to content

Test Governance Rules

Catch common test automation mistakes before they cause problems.

Why Governance?

Test code is still code. Bad patterns lead to:

  • Flaky tests
  • Hard-to-maintain suites
  • Inconsistent practices across teams
  • Technical debt that slows everyone down

AutomateX includes built-in linting rules specifically designed for test automation.


Rule Categories

Test Rules

RuleWhat It Catches
no-raw-locatorsUsing page.locator() directly in tests instead of Page Objects
require-assertionsTests without expect() that can never fail
no-hardcoded-waitsUsing waitForTimeout(5000) instead of proper waits
no-only-or-skipCommitting test.only() or test.skip() to main branch
require-tagsTests without tags that can't be filtered
require-describeTests not organized in describe blocks
max-test-durationTests with excessively long timeouts
max-tests-per-fileToo many tests in a single file
no-duplicate-titlesTests with identical names

Page Object Rules

RuleWhat It Catches
require-base-pagePage classes not extending BasePage
require-urlPages missing URL property
locator-namingLocators not declared as readonly
no-hardcoded-selectorsMagic strings instead of named locators

File & Structure Rules

RuleWhat It Catches
file-namingInconsistent naming (camelCase vs kebab-case)
folder-structureMissing required directories
max-file-linesExcessively long files

Security Rules

RuleWhat It Catches
no-hardcoded-credentialsPasswords or API keys in test code
no-console-logConsole statements left in tests
no-sensitive-dataPII patterns in test files

Auto-Fix Support

Many rules support automatic fixing:

RuleAuto-Fix
no-only-or-skipRemoves .only and .skip
no-console-logRemoves console statements
file-namingSuggests corrected names
no-hardcoded-waitsSuggests replacement patterns

Presets

Pre-configured rule sets for different needs:

PresetStrictnessUse Case
recommendedMediumMost teams
strictHighQuality-focused teams
enterpriseMaximumRegulated industries

Enforce Best Practices

Request early access to add governance to your test suite.

Request Early Access

Built for QA Engineers