{"id":22706796,"url":"https://github.com/bigbinary/neeto-playwright-initializer","last_synced_at":"2025-03-29T20:43:40.012Z","repository":{"id":238195795,"uuid":"793600262","full_name":"bigbinary/neeto-playwright-initializer","owner":"bigbinary","description":"Initialize Playwright tests with just one command.","archived":false,"fork":false,"pushed_at":"2024-09-10T11:46:57.000Z","size":6990,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-02-04T21:43:22.254Z","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/bigbinary.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}},"created_at":"2024-04-29T14:25:09.000Z","updated_at":"2024-05-04T20:01:05.000Z","dependencies_parsed_at":"2025-02-04T21:32:38.962Z","dependency_job_id":"9214451b-0144-4969-ae55-773ac8d0afb3","html_url":"https://github.com/bigbinary/neeto-playwright-initializer","commit_stats":null,"previous_names":["bigbinary/neeto-playwright-initializer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigbinary%2Fneeto-playwright-initializer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigbinary%2Fneeto-playwright-initializer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigbinary%2Fneeto-playwright-initializer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigbinary%2Fneeto-playwright-initializer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigbinary","download_url":"https://codeload.github.com/bigbinary/neeto-playwright-initializer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246243565,"owners_count":20746307,"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-12-10T10:09:45.615Z","updated_at":"2025-03-29T20:43:39.975Z","avatar_url":"https://github.com/bigbinary.png","language":"TypeScript","readme":"# neeto-playwright-initializer\nInitialize Playwright tests with just one command.\n\n## Usage\n\nThis repository is used to initialize a Playwright test directory for a new neeto app. Executing the actions in this repository will let you\ncreate a Playwright test with setup, teardown and all necessary configurations needed for the neeto ecosystem by simply answering a few questions.\n\n### Pre-requisites\n\n1. Create a new project in [neetoPlaydash](https://neeto-engineering.neetoplaydash.com) for the neeto product in which you want to run the tests in.\n2. Create a new project in [Currents.dev](https://app.currents.dev) for the neeto product in which you want to run the tests in.\n\n### Steps\n\n1. Clone the repository and install all the dependencies by executing the command: `yarn install`.\n2. Create the Playwright application by executing the command: `yarn generate`.\n3. You will be asked a series of questions for which you have to provide the proper answers.\n4. Once done a new directory called `playwright-tests-starter` will be generated.\n5. Copy this directory within the neeto app for which you want to write the tests for and rename it to `playwright-tests`.\n6. Navigate inside the directory and initialize it by executing `yarn install`.\n7. Execute `yarn playwright:headed` and the tests should run properly.\n\n## Steps after initialization\n\n### Adding CI configuration\n\nYou need to add the neeto-ci configurations for executing the Playwright tests in the review environment and staging environment and you have to configure\nthe nightly runs. For this create three new files in the .neetoci directory:\n\n```bash\n# Execute at the root of the neeto app\n\ntouch .neetoci/playwright-nightly-staging.yml\ntouch .neetoci/playwright-staging.yml\ntouch .neetoci/playwright.yml\n```\n\nNow add the contents of the newly created configurations as given below. Replace all occurrences of `\u003cneetoapp\u003e` with the proper app name.\nEg: `neetoform`, `neetocal`\n\n```yml\n# .neetoci/playwright-nightly-staging.yml\n\nversion: v1.0\n\nfail_fast: false\nis_cypress: true\nparallelism: 4\nplan: professional-2\n\nenvs:\n  - key: TEST_ENV\n    value: staging\n  - key: DEPLOYMENT_URL\n    value: http://www.neeto.com/\u003cneetoapp\u003e?env=staging\n\nglobal_job_config:\n  setup:\n    - checkout\n    - neetoci-version node 18.12\n    - cache restore\n    - yarn install\n    - cd playwright-tests\n    - yarn install\n    - yarn playwright install --with-deps\n    - cache store\n  jobs:\n    - name: Playwright Staging Nightly\n      commands:\n        - yarn playwright:ci --shard=$((${JOB_COMPLETION_INDEX}+1))/4\n\ntriggers:\n  - event: cron\n    cron_line: \"0 3,15 * * MON,TUE,WED,THU,FRI\"\n    branch: main\n\n```\n\n```yml\n# .nnetoci/playwright-staging.yml\n\nversion: v1.0\n\nfail_fast: false\nis_cypress: true\nparallelism: 4\nplan: professional-2\n\nenvs:\n  - key: TEST_ENV\n    value: staging\n  - key: DEPLOYMENT_URL\n    value: http://www.neeto.com/\u003cneetapp\u003e?env=staging\n\nglobal_job_config:\n  setup:\n    - checkout\n    - neetoci-version node 18.12\n    - cache restore\n    - yarn install\n    - cd playwright-tests\n    - yarn install\n    - yarn playwright install --with-deps\n    - cache store\n  jobs:\n    - name: Playwright Staging\n      commands:\n        - yarn playwright:ci --shard=$((${JOB_COMPLETION_INDEX}+1))/4\n\nlifecycle:\n  on_running:\n    - action: remove_labels\n      labels: [\"playwright-staging-completed\", \"playwright-staging-run\"]\n    - action: add_labels\n      labels: [\"playwright-staging-triggered\"]\n\n  on_complete:\n    - action: remove_labels\n      labels: [\"playwright-staging-run\", \"playwright-staging-triggered\"]\n    - action: add_labels\n      labels: [\"playwright-staging-completed\"]\n\ntriggers:\n  - event: pull_request_labeled\n    label: playwright-staging-run\n\n```\n\n```yml\n# .nnetoci/playwright.yml\n\nversion: v1.0\n\nfail_fast: false\nis_cypress: true\nparallelism: 4\nplan: professional-2\n\nenvs:\n  - key: TEST_ENV\n    value: review\n\nglobal_job_config:\n  setup:\n    - checkout\n    - neetoci-version node 18.12\n    - cache restore\n    - yarn install\n    - cd playwright-tests\n    - yarn install\n    - yarn playwright install --with-deps\n    - cache store\n  jobs:\n    - name: Playwright Review\n      commands:\n        - yarn playwright:ci --shard=$((${JOB_COMPLETION_INDEX}+1))/4\n\nlifecycle:\n  on_running:\n    - action: remove_labels\n      labels: [\"playwright-completed\", \"playwright-run\"]\n    - action: add_labels\n      labels: [\"playwright-triggered\"]\n\n  on_complete:\n    - action: remove_labels\n      labels: [\"playwright-run\", \"playwright-triggered\"]\n    - action: add_labels\n      labels: [\"playwright-completed\"]\n\ntriggers:\n  - event: pull_request_labeled\n    label: playwright-run\n\n```\n\n### Moving the generated .gitignore entries\n\nWhen generating the starter Playwright code, we generate some required .gitignore files along with it. Since the application already has a\n.gitignore file, its redundant to keep two files. So we can move all the .gitignore entries in the `playwright-tests` directory to the one\nin the root of the application. To do this you can copy the entries in the the `playwright-tests/.gitignore` file to the `.gitignore` file\nand prefix all the of them with `/playwright-tests/`\n\n```\n# playwright-tests/.gitignore\n\nnode_modules/\n/test-results/\n/playwright-report/\n/blob-report/\n\n...\n```\n\n```\n# .gitignore\n\n/playwright-tests/node_modules/\n/playwright-tests/test-results/\n/playwright-tests/playwright-report/\n/playwright-tests/blob-report/\n\n...\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigbinary%2Fneeto-playwright-initializer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigbinary%2Fneeto-playwright-initializer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigbinary%2Fneeto-playwright-initializer/lists"}