{"id":44148867,"url":"https://github.com/vasu31dev/playwright-ts-lib","last_synced_at":"2026-03-17T05:26:32.517Z","repository":{"id":189602922,"uuid":"680801275","full_name":"vasu31dev/playwright-ts-lib","owner":"vasu31dev","description":"Reusable Helper methods for Playwright Library in Typescript","archived":false,"fork":false,"pushed_at":"2026-02-09T01:35:31.000Z","size":332,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-09T07:28:45.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vasu31dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-20T12:59:57.000Z","updated_at":"2026-02-09T01:35:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7c18ff7-ff47-4ff1-a58b-aafe7db8968c","html_url":"https://github.com/vasu31dev/playwright-ts-lib","commit_stats":null,"previous_names":["vasu31dev/playwright-ts-lib"],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/vasu31dev/playwright-ts-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasu31dev%2Fplaywright-ts-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasu31dev%2Fplaywright-ts-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasu31dev%2Fplaywright-ts-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasu31dev%2Fplaywright-ts-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vasu31dev","download_url":"https://codeload.github.com/vasu31dev/playwright-ts-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasu31dev%2Fplaywright-ts-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29888160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T07:54:54.515Z","status":"ssl_error","status_checked_at":"2026-02-27T07:54:49.177Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-09T03:07:53.069Z","updated_at":"2026-03-17T05:26:32.510Z","avatar_url":"https://github.com/vasu31dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Playwright TypeScript Utility Functions Library\n\n[![GitHub stars](https://img.shields.io/github/stars/vasu31dev/playwright-ts-lib)](https://github.com/vasu31dev/playwright-ts-lib/stargazers)\n![Last Commit](https://img.shields.io/github/last-commit/vasu31dev/playwright-ts-lib) ![Pull Requests](https://img.shields.io/github/issues-pr-raw/vasu31dev/playwright-ts-lib)\n[![npm version](https://img.shields.io/npm/v/vasu-playwright-utils.svg)](https://www.npmjs.com/package/vasu-playwright-utils)\n[![Release Notes](https://img.shields.io/badge/Release%20Notes-📝-brightgreen)](https://github.com/vasu31dev/playwright-ts-lib/blob/main/CHANGELOG.md)\n\n## About\n\n`playwright-ts-lib` is a TypeScript library that provides reusable helper methods for the Playwright Library. It aims to simplify common tasks and enhance the efficiency of automated testing workflows.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [ESLint](#eslint)\n- [AI Agent Skills](#ai-agent-skills)\n- [License](#license)\n\n## Installation\n\nTo install the library, run the following command:\n\n```bash\nnpm install vasu-playwright-utils  --save-dev\n```\n\n## Usage\n\nHere's a simple example of how you can use the library:\n\n```typescript\nimport { click, fill } from 'vasu-playwright-utils';\n\n// Your code here\n```\n\n## ESLint\n\nThis library ships a shareable ESLint config for Playwright TypeScript projects. Install the library (it includes the required ESLint plugins), then extend the config in your project and override any rules as needed.\n\n### Using the config\n\n1. Use **ESLint 9 flat config** (`eslint.config.mjs` at your project root).\n\n2. In your `eslint.config.mjs`, spread the library config:\n\n```javascript\nimport playwrightLibConfig from 'vasu-playwright-utils/eslint';\n\nexport default [...playwrightLibConfig];\n```\n\n3. Ensure your project has a `tsconfig.json` at the root (the config uses it for TypeScript parsing).\n\n### Overriding rules\n\nAdd config objects after the spread to override or relax rules:\n\n```javascript\nimport playwrightLibConfig from 'vasu-playwright-utils/eslint';\n\nexport default [\n  ...playwrightLibConfig,\n  // Override specific rules\n  {\n    rules: {\n      'playwright/no-focused-test': 'warn',\n      'playwright/no-wait-for-timeout': 'off',\n      'no-console': 'off',\n    },\n  },\n  // Or override only for certain files\n  {\n    files: ['tests/**/*.ts'],\n    rules: {\n      'playwright/expect-expect': 'error',\n    },\n  },\n];\n```\n\nLater entries in the config array override earlier ones, so your overrides take precedence.\n\n## AI Agent Skills\n\nThis library ships with AI skills and agent workflows for [Claude Code](https://claude.com/claude-code) and [Cursor](https://cursor.com) that help AI agents understand the `vasu-playwright-utils` API and use `playwright-cli` for browser automation.\n\n### What gets installed\n\n| Component                                                    | Installed to                            | Used by             |\n| ------------------------------------------------------------ | --------------------------------------- | ------------------- |\n| **Skills** — API docs, locator strategy, function references | `.claude/skills/vasu-playwright-utils/` | Claude Code, Cursor |\n| **Playwright CLI skills** — browser automation commands      | `.claude/skills/playwright-cli/`        | Claude Code, Cursor |\n| **Agents** — test planner, generator, healer workflows       | `.claude/agents/`                       | Claude Code         |\n| **Cursor rules** — agent workflow rules with `@file` refs    | `.cursor/rules/`                        | Cursor              |\n| **CLAUDE.md loader** — links your `CLAUDE.md` into Cursor    | `.cursor/rules/project.mdc`             | Cursor              |\n\nFiles are **copied** (not symlinked) into your project. Both Claude Code and Cursor auto-discover `.claude/skills/`. Claude Code also auto-discovers `.claude/agents/`. Cursor uses `.cursor/rules/` to reference agent files. If your project has a `CLAUDE.md`, the setup also creates a Cursor rule that loads it via `@file CLAUDE.md`, so both tools share the same project instructions.\n\n### For consumers\n\nInstall everything (skills + agents) with a single command:\n\n```bash\nnpx vasu-pw-setup\n```\n\nOr install only what you need:\n\n```bash\n# Skills only (API docs, locator strategy, playwright-cli)\nnpx vasu-pw-setup --skills\n\n# Agents only (test planner, generator, healer)\nnpx vasu-pw-setup --agents\n```\n\nTo update after upgrading the library, run the command again with `--force`:\n\n```bash\nnpx vasu-pw-setup --force\n```\n\n### How skills and agents are invoked\n\n- **Claude Code** auto-discovers `.claude/skills/` and `.claude/agents/`. `CLAUDE.md` instructs the agent to use `playwright-cli` and `vasu-playwright-utils` skills when writing tests, and to follow agent workflows (Planner / Generator / Healer) when asked to plan, generate, or fix tests.\n- **Cursor** auto-discovers `.claude/skills/` for API reference. Rules in `.cursor/rules/` activate on `*.spec.ts`, `specs/**`, and `tests/**` files and include the agent workflows via `@file` directives pointing to `.claude/agents/`.\n\nTo test: ask the agent to \"write a test case to login for https://example.com\" (or any URL). The agent should use `playwright-cli` to verify the flow and the `vasu-playwright-utils` skill (with locator strategy) when writing selectors.\n\n### For contributors\n\nSkills, agents, and cursor rules are pre-installed via symlinks — edit the source directories and changes are reflected everywhere:\n\n| Symlink                                   | Source of truth                          |\n| ----------------------------------------- | ---------------------------------------- |\n| `.claude/skills/vasu-playwright-utils`    | `skills/vasu-playwright-utils/`          |\n| `.claude/agents`                          | `agents/`                                |\n| `.cursor/rules/playwright-agents.mdc`     | `cursor-rules/playwright-agents.mdc`     |\n| `.cursor/rules/vasu-playwright-utils.mdc` | `cursor-rules/vasu-playwright-utils.mdc` |\n\n`.cursor/rules/project.mdc` loads `CLAUDE.md` into Cursor so both Claude Code and Cursor share the same project instructions.\n\n## Issues and Feedback\n\nIf you encounter any issues or have feedback, please [Raise an Issue](https://github.com/vasu31dev/playwright-ts-lib/issues) on GitHub.\n\n## Contributions\n\nWe welcome contributions! Feel free to submit a [Pull Request](https://github.com/vasu31dev/playwright-ts-lib/pulls) on GitHub.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasu31dev%2Fplaywright-ts-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasu31dev%2Fplaywright-ts-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasu31dev%2Fplaywright-ts-lib/lists"}