templates/directory: All distributable assets (skills, agents, cursor rules, CLAUDE.md) consolidated undertemplates/for reliable npm publishing — no root-levelskills/,agents/, orcursor-rules/directories needed.templates/skills/playwright-cli/: Playwright CLI skill bundled in the package (SKILL.md + references: request-mocking, running-code, session-management, storage-state, test-generation, tracing, video-recording). Consumers no longer need a separatenpx @playwright/cli install --skillsstep.scripts/setup.js: Setup script moved frombin/setup.jstoscripts/setup.js. New implementation copies all assets fromtemplates/with no path rewriting at install time — cursor rule@filepaths are pre-baked as.claude/paths in templates.--force-claudeflag:npx vasu-pw-setup --force-claudeoverwritesCLAUDE.mdindependently of--force, preserving customised project instructions by default.sync:playwright-cli-skillscript:npm run sync:playwright-cli-skillwipes and copies.claude/skills/playwright-cli→templates/skills/playwright-clifor maintainers to sync upstream skill updates before publishing.
- Cursor rules in
templates/:@filedirectives use.claude/paths directly, so no runtime path rewriting is needed during install. templates/cursor-rules/playwright-agents.mdc: Updated inline locator reference from`skills/vasu-playwright-utils/references/locators.md`to`.claude/skills/vasu-playwright-utils/references/locators.md`.- Dev symlinks:
.claude/agents,.claude/skills/vasu-playwright-utils, and all.cursor/rules/*.mdcsymlinks updated to point intotemplates/instead of the former root-level directories. - README: Contributor symlink table updated to reflect
templates/as source of truth;--force-claudeflag documented;sync:playwright-cli-skillusage added.
- ESLint import/order:
import/orderrule ineslint.config.base.mjsfor consistent import declaration order (builtin → external → internal → parent → sibling → index) with alphabetize and path groups for@/**; auto-fix viaeslint --fix.sort-importskept withignoreDeclarationSort: truefor member order within named imports only. - PostToolUse hook (Claude/Cursor):
.claude/settings.jsonconfig to run Prettier on edited.ts/.tsxfiles after Edit/Write tool use.
- Import order: Sorted imports across source, tests, and config with
npm run lint:fixto satisfy the new import/order rule. - Assertions skill (references/assertions.md): Do not use assertions in spec files—only in page
verify*methods. Added good spec examples for readable tests. - Tests: Removed redundant add-to-cart test case.
- lint-staged: For staged
*.tsfiles, lint-staged now runseslint --fixtheneslintso auto-fixable issues are applied in the index and remaining errors are reported (commit blocked until lint passes).
- CLAUDE.md template: New
templates/CLAUDE.mdwith project overview, structure, conventions, and AI tooling for Playwright TypeScript projects. Setup script copies it to the project root when installing skills (unless one exists; use--forceto overwrite). - Setup (bin/setup.js): When installing skills, setup now installs the CLAUDE.md template and links the Cursor project rule so Cursor and Claude Code share the same project instructions.
- Locators skill (references/locators.md): Priority reordered so unique XPath/CSS with stable attributes come before role/text locators. Prefer stable selectors so failures distinguish "element missing" (bug) from "copy/locale changed." Added checkout-complete example using
[data-test="complete-header"]and asserting text separately. - Sauce Demo checkout page:
orderCompleteMessagenow uses stable selectorgetLocator('[data-test="complete-header"]')instead ofgetLocatorByRole('heading', { name: /thank you for your order/i }); text is still asserted inexpectElementToContainText. - Package:
overridesadded soplaywrightresolves to stable only (^1.58.2) when using@playwright/cli;templatesincluded in publishedfiles. - Agents: Minor updates to playwright-test-generator, playwright-test-healer, and playwright-test-planner.
- Cursor rules / README: Small updates for project and docs.
- Checkout page (Sauce Demo):
getCheckoutOverviewItemTotal()andverifyCheckoutOverviewItemTotal(expectedTotal)for the new checkout overview test case. - AI IDE support: Skills and agents work in both Claude Code (
.claude/skills/,.claude/agents/) and Cursor (.cursor/rules/, Cursor agents); symlinks and docs keep the same content available in both environments.
- vasu-playwright-utils: Library API and locator strategy; references for locators, actions, assertions, and browser strategy.
- playwright-cli: Browser automation (open, goto, click, fill, snapshot, etc.); references for request mocking, video recording, tracing, test generation, running code, session management, and storage state.
- playwright-test-planner: Creates test plans from app exploration.
- playwright-test-generator: Generates test files from test plan steps using vasu-playwright-utils.
- playwright-test-healer: Debugs and fixes failing Playwright tests.
@eslint/js: ^9.39.4@types/node: ^25.3.1 → ^25.5.0@typescript-eslint/eslint-plugin,@typescript-eslint/parser: ^8.56.1 → ^8.57.1eslint: ^9.39.3 → ^9.39.4eslint-plugin-jsdoc: ^62.7.1 → ^62.8.0eslint-plugin-playwright: ^2.7.1 → ^2.10.0
- ESLint config as ESM: Converted
eslint.config.jsandeslint.config.base.jsto.mjs(ES module) to fix the "CommonJS module; may be converted to an ES module" lint warning. Single source of truth is noweslint.config.base.mjs; this repo useseslint.config.mjs(base + local overrides). - Package: Export
"./eslint"now points toeslint.config.base.mjs; publishedfilesincludeeslint.config.base.mjs. - Consumers: Use
eslint.config.mjswithimport playwrightLibConfig from 'vasu-playwright-utils/eslint'andexport default [...].require()is not supported for the published ESM config. - README: ESLint section updated to document ESM usage (
eslint.config.mjs,import/export default).
- Shareable ESLint config: New flat config for Playwright TypeScript projects. Consume via
vasu-playwright-utils/eslintin youreslint.config.mjsand override rules as needed. - README: New ESLint section with usage, spreading the config, and examples for overriding rules and file-specific overrides.
- Sample config:
eslint.config.sample.mjs(ESM) showing how to extend the shareable config and override rules.
- Engines: Node.js requirement updated from
>=18.0.0to>=20.0.0. - Package: Export
"./eslint"added; config included in publishedfiles. - Shareable ESLint config: Single source; JSDoc rules
jsdoc/check-alignmentandjsdoc/check-indentationset tooff. Project root viaprocess.cwd()for portability. - Local ESLint: JSDoc rules
jsdoc/check-alignmentandjsdoc/check-indentationoverridden towarnin this repo (base staysofffor consumers).
@types/node: ^25.2.3 → ^25.3.1@typescript-eslint/eslint-plugin,@typescript-eslint/parser: ^8.55.0 → ^8.56.1dotenv: ^17.2.4 → ^17.3.1eslint: ^9.39.2 → ^9.39.3eslint-plugin-jsdoc: ^62.5.4 → ^62.7.1eslint-plugin-playwright: ^2.5.1 → ^2.7.1rimraf: ^6.1.2 → ^6.1.3
- downloadFile (action-utils): Removed use of
download.path(), which is unavailable when connecting to a remote browser (e.g. Docker or cloud). The method now uses onlysaveAs(savePath), so file downloads work both locally and when connecting remotely.
- downloadFile (action-utils): Now returns the suggested filename (or a fallback from
savePath) for use in assertions or logging. Added explicit failure check before save and improved JSDoc and examples.
-
getLocatorByTestId(locator-utils) update: The optionalattributeNameparameter has been removed. The method now always uses Playwright’s default test id attribute (configured inplaywright.config.ts). If you relied on a custom attribute name by passing attributeName, replace it with an alternate Playwright locator or use a CSS selector (e.g.[data-testid="id"]) or XPath as needed. -
Updated
@typescript-eslint/eslint-pluginand@typescript-eslint/parserfrom^8.54.0to^8.55.0.
- Updated npm publish workflow to use Node.js
24. - Added
id-token: writeGitHub Actions permission. - Switched publish step to
npm publish --provenance --access public.
- Enforced stricter ESLint and TypeScript rules, including nullish-coalescing and async safety checks.
- Added Playwright recommended rule set from
plugin:playwright/playwright-test. - Tightened import and general best-practice rules (
import/first,no-var,prefer-const,eqeqeq, and others).
- Refactored utility functions to prefer nullish coalescing (
??) over logical OR (||) where fallback-on-null/undefined is required.
- Updated
@types/nodefrom^25.2.1to^25.2.2andeslint-plugin-jsdocfrom^62.5.3to^62.5.4.
- Removed
allure-commandline,allure-playwright,axios.
- Playwright: Updated peer dependency from
>=1.52.0to>=1.58.2 - ESLint: Updated
@eslint/jsandeslintto9.39.2(v10 not compatible with@typescript-eslint/eslint-plugin)
- TypeScript Tooling:
@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,typescript - Testing & Reporting:
allure-commandline,allure-playwright - Utilities:
axios,cross-env,dotenv,winston - Code Quality:
eslint-config-prettier,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-jsdoc,eslint-plugin-playwright,eslint-plugin-prettier,lint-staged,prettier - Build Tools:
rimraf
- ESLint v10 intentionally not used due to compatibility requirements with TypeScript ESLint plugin ecosystem
- Updated
playwrightfrom version1.48.1to1.52.0. - Updated all corresponding dependencies to their latest versions.
- New ESLint v9 configuration
- Added @eslint/js dependency
- Removed .eslintrc.js and .eslintignore (ESLint v8 configuration)
- Improved the
clickAndNavigatemethod to handle element staleness and navigation errors more robustly. The method now waits for the element clicked to become hidden or stale after navigation and includes enhanced error handling for better debugging.
- Updating getAllLocators, getAllTexts, getLocatorCount to auto wait by adding waitForFirstElementToBeAttached method
- Updated
playwrightfrom version1.44.1to1.48.1. - Updated all corresponding dependencies to their latest versions.
- New GitHub workflow to run tests on pushes to the main branch.
- New GitHub workflow to publish the package to npm.
- Updated
playwrightfrom version1.44.1to1.47.1. - Updated all corresponding dependencies to their latest versions.
- Updated
playwrightfrom version1.41.2to1.44.1. - Updated all corresponding dependencies to their latest versions.
- Fix API utils module under exports in package.json
- API Utils for enhanced network interaction within tests. Includes utility functions for performing HTTP requests (GET, POST, PUT, DELETE) using Playwright's
APIRequestContext. This addition simplifies the process of interacting with APIs directly from test scripts, providing a more integrated and efficient testing workflow.getAPIRequestContext(): Retrieves theAPIRequestContextfrom the current page, equivalent to the request object from Playwright's fixture, enabling seamless network operations within tests.getRequest(url: string, options?): Performs a GET request to the specified URL with optional configuration.postRequest(url: string, options?): Allows sending POST requests to a specified URL, supporting optional parameters for body content and headers.putRequest(url: string, options?): Facilitates PUT requests for updating resources at the specified URL, with support for optional configuration.deleteRequest(url: string, options?): Implements DELETE requests to remove resources from the specified URL, also supporting optional parameters.
- Stable optional parameter for
action-utilfunctions likeclick,fill,check, etc., to increase the reliability of actions performed in tests. - Enhanced
getFramefunctionality to throw an error if the frame is not found when the optionalforceparameter is set totrue. Defaults tofalse.
- Moved
@playwright/testdependency topeerDependenciesto provide more flexibility in version management for users of the library. The required version is now>=1.41.1. - Updated all packages to their latest versions to incorporate the latest features and security updates.
.eslintrcconfiguration file with.eslintrc.jsto allow for more dynamic and programmable ESLint configurations.
- Improved the
closePagemethod for enhanced reliability and usability. The method now automatically invokesswitchToDefaultPagewhen such a page is available.
- Updated all corresponding dependencies to their latest versions.
- New method
clearByJSin case Playwright's clear function doesn't work as expected. This method provides an alternative way to clear input fields using JavaScript. clickAndNavigatefunction now throws a more descriptive error message to facilitate easier debugging.- Added new method
fillAndTabinaction-utilsfor filling input fields and simulating a tab press, improving form handling automation. - New method
getContextadded inpage-utils, offering a straightforward way to retrieve the browser context for advanced testing scenarios.
pressKeyboardfunction is now divided intopressPageKeyboardandpressLocatorKeyboardfunctions to provide more targeted keyboard interaction capabilities. This change allows for more precise control over where keyboard inputs are sent, whether to the page or specific element locators.
- Splitting
pressKeyboardintopressPageKeyboardandpressLocatorKeyboardmay require updates to existing tests that utilize the originalpressKeyboardmethod. This modification aims to enhance test script specificity and efficiency but will necessitate changes to maintain compatibility.
- Updated
playwrightfrom version1.40.1to1.41.2. - Updated all corresponding dependencies to their latest versions.
acceptAlert,dismissAlert,getAlertTextFunction: Improved the functions to efficiently handle the alert dialogs. It now ensures that the function does not hang if an alert is not triggered after the specified timeout period.
-
expectAlertToHaveTextFunction: Introduced a new function for asserting that the text from an alert dialog exactly matches a provided string. -
expectAlertToMatchTextFunction: Added a new function that allows assertions against the text from an alert dialog to be made using either a string for partial matches or a regular expression for pattern matching.
- Published the
srcfolder in the npm package to facilitate easier debugging by consumers of the library.
- Updated
playwrightfrom version1.40.0to1.41.1. - Updated all corresponding dependencies to their latest versions.
- Corrected the path of the compiled
distfolder by adjusting theexportssection inpackage.jsonto properly include thesrcfolder. This ensures correct resolution of module paths when the package is consumed.
- Added Tests within the repository to ensure library updates function as expected.
- Configuration to publish only the
srcfolder, excluding test-related files and directories from the npm package.
- Moved page related functions from
action-utilsandelement-utilstopage-utils. action-utilstopage-utils:gotoURL,waitForPageLoadState,reloadPage,goBack,wait-
element-utilstopage-utils:getURL,getWindowSize,saveStorageState
- Updated
playwrightfrom version1.40.1to1.41.0. - Updated all corresponding dependencies to their latest versions.
expectElementNotToBeInViewportreusable method for asserting an element's absence in the current viewport.onlyVisibleparameter to locators in action-utils for enhanced stability and precision.setDefaultLocatorFilterVisibilityto allow dynamic configuration.- Getter and setter functions for
defaultLoadStateto allow dynamic configuration.
getFramemethod now throws an error if the frame is not found. Added an optionalforceparameter for conditional error handling.- Updated all corresponding dependencies to their latest versions.
- Moved
playwrightfrom peer dependencies to dependencies section and updated from version1.38.1to1.40.1. - Updated all corresponding dependencies to their latest versions.
@types/nodefrom^20.8.7to^20.10.3@typescript-eslint/eslint-pluginfrom^6.8.0to^6.13.1@typescript-eslint/parserfrom^6.8.0to^6.13.1axiosfrom^1.5.1to^1.6.2eslintfrom^8.52.0to^8.55.0eslint-config-prettierfrom^9.0.0to^9.1.0eslint-plugin-jsdocfrom^46.8.2to^46.9.0eslint-plugin-playwrightfrom^0.18.0to^0.19.0lint-stagedfrom^15.0.2to^15.2.0prettierfrom^3.0.3to^3.1.0typescriptfrom5.2.2to5.3.2
- This update includes significant dependency upgrades and a change in the way Playwright is included in the project. It is recommended to test existing functionalities thoroughly to ensure compatibility with the new versions.
- Added
pressKeyboardmethod to simulate keyboard interactions, such as pressing keys or key combinations. - Added
getWindowSizemethod to retrieve the current size of the browser window, including width and height.
- Updated package versions. Major updates to current latest versions include
@typescript-eslint/eslint-plugin,@typescript-eslint/parser,allure-playwright, andlint-staged.
- Changed the version specifier for the
@playwright/testpeer dependency from^1.38.1to~1.38.1to pin to patch releases and avoid a known issue in version 1.39.0. For more details on the issue, see microsoft/playwright#27733.
- Replaced the
typereusable function withpressSequentially. This change enhances the typing simulation but may require updates to existing test scripts that use thetypefunction.
- Upgraded the Playwright dependency from version 1.37.1 to 1.38.1 to leverage new features and performance improvements.
- Upgraded all dependencies to their latest stable versions.
closePageFunction: Resolved an issue where the optional parameter was not being handled correctly. This fix enhances the function's reliability and prevents unexpected behavior.
- Fixed the assertions for page size.
- Added
getAllPagesandexpectPageSizeToBeEqualToreusable functions. - Added
getFramereusable function.
saveStorageStatefunction will now return the storage state instead ofvoid.
- Updated all the dependencies to the latest versions.
- Optimized
page-utilswith better error handling forswitchPage,switchToDefaultPage,closePagefunctions. - Added
SwitchPageOptionsoptional parameter type toswitchPage.
- Added new utility functions in
element-util:waitForElementToBeAttached: Waits for an element to be attached to the DOM.waitForElementToBeDetached: Waits for an element to be detached from the DOM.waitForElementToBeVisible: Waits for an element to be visible on the page.waitForElementToBeHidden: Waits for an element to be hidden on the page.
- Introduced
waitForElementToBeStablefunction to improve element stability checks during test execution. This function waits for an element to be stable in its position before proceeding with further actions.
- Fixed
clickByJSto work correctly with bothSVGElementandHTMLElementby adding type checks.
- Introduced axios and Allure report as new dependencies.
- Upgraded all dependencies to their latest stable versions.
- Added Prettier linting support for Windows via the
cross-envpackage. - Included
srcdirectory in the npm package for easier source code debugging.
- Removed the
postinstallscript to fix the installation issues.
- Extended API by exporting various utility classes like
ActionUtils,AssertUtils,ElementUtils,LocatorUtils,PageUtils,ParameterTypes, andTimeouts.
- Exported
custom-loggerfor enhanced logging capabilities.
- Removed
page-setuplibrary to avoid conflicts with Playwright Test'stest.beforeEach()method.
- Addressed an issue preventing the import of
Customlogger.
- Resolved import issues related to newly added libraries.
- Optimized
devDependencies,dependencies, andpeerDependenciesfor better project compatibility.
- Updated all dependencies to the latest versions.
- Introduced
assert-utilsfor advanced Playwright assertions. - Added
custom-loggerfor improved and colored console output. - Implemented
page-setupfor pre-test page configurations.
- Migrated from
playwrightto@playwright/testfor enhanced test handling.
- Enabled relative imports for utility functions.
- Initial release with basic functionalities.