{"id":13650836,"url":"https://github.com/AndrewUsher/playwright-chrome-recorder","last_synced_at":"2025-04-22T18:32:49.920Z","repository":{"id":154440000,"uuid":"632220423","full_name":"AndrewUsher/playwright-chrome-recorder","owner":"AndrewUsher","description":"playwright-chrome-recorder","archived":false,"fork":false,"pushed_at":"2023-05-01T17:32:06.000Z","size":42,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-17T04:28:28.978Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewUsher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-04-25T00:57:17.000Z","updated_at":"2024-04-09T23:12:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"48b7b506-6604-44d4-9e0d-1e8a5fa64b1c","html_url":"https://github.com/AndrewUsher/playwright-chrome-recorder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewUsher%2Fplaywright-chrome-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewUsher%2Fplaywright-chrome-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewUsher%2Fplaywright-chrome-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewUsher%2Fplaywright-chrome-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewUsher","download_url":"https://codeload.github.com/AndrewUsher/playwright-chrome-recorder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223903215,"owners_count":17222497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-08-02T02:00:41.507Z","updated_at":"2024-11-10T01:31:13.220Z","avatar_url":"https://github.com/AndrewUsher.png","language":"TypeScript","funding_links":[],"categories":["Integrations"],"sub_categories":[],"readme":"# playwright-chrome-recorder\n\n\n\nThis repo provides tools to export P Tests from [Google Chrome DevTools' Recordings](https://goo.gle/devtools-recorder) programmatically.\n\n## Prerequisites\n\nIn order to export JSON files from Chrome DevTools Recorder you will need to be on Chrome 101 or newer.\n\n`dblClick` and `rightclick` require Chrome 103 or newer.\n\n## Installation\n\n```sh\n$ npm install -g playwright-chrome-recorder\n```\n\n## Usage\n\n### Via CLI\n\nTo use the interactive CLI, run:\n\n```sh\n$ npx playwright-chrome-recorder\n```\n\nThe CLI will prompt you to enter the path of the directory or file that you would like to modify as well as a path to write the generated playwright tests to.\n\nIf you prefer to enter paths via the CLI, you can run the following command to export individual recordings:\n\n```sh\n$ npx playwright-chrome-recorder \u003crelative path to target test file\u003e\n```\n\nor for folders containing multiple recordings:\n\n```sh\n$ npx playwright-chrome-recorder \u003crelative path to target test folder\u003e/*.json\n```\n\nBy default the output will be written to a `playwright` folder in the current working directory.\n\nIf you prefer a different output directory, specify that via CLI:\n\n```sh\n$ npx playwright-chrome-recorder \u003crelative path to target test folder\u003e/*.json --output=folder-name\n```\n\nor via the interactive CLI prompts.\n\n### CLI Options\n\n| Option       | Description                                               |\n| ------------ | --------------------------------------------------------- |\n| -f, --force  | Bypass Git safety checks and force exporter to run        |\n| -d, --dry    | Dry run (no changes are made to files)                    |\n| -o, --output | Output location of the files generated by the exporter    |\n| -p, --print  | Print transformed files to stdout, useful for development |\n\n### Via Import\n\n```js\nimport { playwrightStringifyChromeRecording } from 'playwright-chrome-recorder';\n\nconst stringifiedContent = await playwrightStringifyChromeRecording(\n  recordingContent\n);\n\nreturn stringifiedContent;\n```\n\n## Supported Chrome Recorder Step Types\n\nBelow are the step types that are currently supported:\n\n| Type                | Description                                   |\n| ------------------- | --------------------------------------------- |\n| change              | becomes **page.locator(\"_element_\").type(\"text\")**  |\n| click               | becomes **page.locator(\"_element_\").click();**      |\n| click (right click) | becomes **page.locator(\"_element_\").click({ button: 'right' });** |\n| doubleClick         | becomes **page.locator(\"_element_\").dblclick();**   |\n| hover               | becomes **page.locator(\"_element_\").hover();**    |\n| keyDown             | becomes **page.keyboard.down(\"{key}\")**                  |\n| keyUp               | _not exported at this time_                   |\n| navigate            | becomes **await page.goto(\"url\")**                   |\n| setViewport         | becomes **await page.setViewportSize({ width, height })**        |\n| scroll              | becomes **await page.mouse.wheel(x, y)** |\n\n\nIf a step type is not listed above, then a warning message should be displayed in the CLI.\n\n## License\n\nThis project is licensed under the terms of the [MIT license](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrewUsher%2Fplaywright-chrome-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAndrewUsher%2Fplaywright-chrome-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrewUsher%2Fplaywright-chrome-recorder/lists"}