{"id":28438390,"url":"https://github.com/marcisbee/playwright-gen-example","last_synced_at":"2025-06-28T15:30:44.430Z","repository":{"id":272577999,"uuid":"917075353","full_name":"Marcisbee/playwright-gen-example","owner":"Marcisbee","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-29T13:46:20.000Z","size":371,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T07:21:35.829Z","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/Marcisbee.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-15T10:02:01.000Z","updated_at":"2025-04-29T13:46:23.000Z","dependencies_parsed_at":"2025-01-15T11:57:30.890Z","dependency_job_id":"5d9becda-33a9-4abc-baf9-2fc8bc723308","html_url":"https://github.com/Marcisbee/playwright-gen-example","commit_stats":null,"previous_names":["marcisbee/playwright-gen-example"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Marcisbee/playwright-gen-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fplaywright-gen-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fplaywright-gen-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fplaywright-gen-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fplaywright-gen-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marcisbee","download_url":"https://codeload.github.com/Marcisbee/playwright-gen-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fplaywright-gen-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262452075,"owners_count":23313375,"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":"2025-06-06T01:06:55.457Z","updated_at":"2025-06-28T15:30:44.424Z","avatar_url":"https://github.com/Marcisbee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Playwright test gen\n\n## Desktop app install (optional):\n```sh\ncurl -SsfL https://raw.githubusercontent.com/Marcisbee/playwriter/refs/heads/main/install.sh | bash\n```\n\nTo work with this you'll need to run these commands in \"Terminal\" app from macos (note that mouse probably won't really help there, use keyboard).\n\n1. Run all tests:\n```sh\n./tasks.sh test\n```\n\nIf some test fails, terminal process will remain active + it'll open report in browser. To cancel/close process in terminal, press CTRL+C.\n\n---\n\n## Todo test example\n- Generate simple test:\n```sh\n./tasks.sh codegen --output=\"tests/todo-mvc-2.ts\" https://demo.playwright.dev/todomvc\n```\n\nIt will start test with `https://demo.playwright.dev/todomvc` as initial page and save test file in `tests/todo-mvc-2.ts`.\n\nMake sure test file ends with `.ts` file extension.\nClose browser to end test generation.\n\n---\n\n## Pocketbase/Login test example\n\nIt will start test with `https://demo.playwright.dev/todomvc` as initial page.\n\n1. Create pocketbase auth session (make sure output file is named `setup.ts`):\n```sh\n./tasks.sh codegen https://pocketbase.io/_ --output=\"session/pocketbase/setup.ts\" --save-storage=\"session/pocketbase/auth.json\"\n```\n\nOpen setup.ts file and append (some playwright bug that it doesn't generate this part) after last line with `await` in front:\n```ts\nawait page.context().storageState({ path: 'session/pocketbase/auth.json' });\n```\n\n2. Create pocketbase tests (prepend 001, 002, etc to set execution order, note `setup.ts` files will always run before everything else):\n```sh\n./tasks.sh codegen https://pocketbase.io/_ --output=\"tests/pocketbase/001-add-collection.ts\" --load-storage=\"session/pocketbase/auth.json\"\n```\n```sh\n./tasks.sh codegen https://pocketbase.io/_ --output=\"tests/pocketbase/002-add-row.ts\" --load-storage=\"session/pocketbase/auth.json\"\n```\n```sh\n./tasks.sh codegen https://pocketbase.io/_ --output=\"tests/pocketbase/003-remove-row.ts\" --load-storage=\"session/pocketbase/auth.json\"\n```\n```sh\n./tasks.sh codegen https://pocketbase.io/_ --output=\"tests/pocketbase/004-remove-collection.ts\" --load-storage=\"session/pocketbase/auth.json\"\n```\n\n3. Run only pocketbase tests:\n```sh\n./tasks.sh test --grep \"/pocketbase/\"\n```\n\n4. Get report:\n```sh\n./tasks.sh show-report\n```\n\n## Adding new dynamic variable\n\nOpen `env.config` file and add a new line with name of the variable and type separated by equals sign `=`.\n\nExample:\n```\nMY_NEW_VARIABLE=generic\n```\n\nThere are multiple types available:\n- `generic` - will make random value similar to this: `TEST_1743667557969`\n- `email` - will make random value similar to this: `rand_qa_pw+1743667557970@mail7.app`\n\n## Using dynamic variable\n\nOpen test file that was recorded. Find all of the places where value you want to replace with dynamic is used. Then replace it with this:\n```\n'+process.env.MY_NEW_VARIABLE+'\n```\n_(don't forget to replace `MY_NEW_VARIABLE` with the one you want to use)_.\n\n#### Example:\n- Before\n```ts\n  await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('asd');\n```\n\n- After:\n```ts\n  await page.getByRole('textbox', { name: 'What needs to be done?' }).fill(''+process.env.MY_NEW_VARIABLE+'');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcisbee%2Fplaywright-gen-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcisbee%2Fplaywright-gen-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcisbee%2Fplaywright-gen-example/lists"}