{"id":27941167,"url":"https://github.com/ew-code/pw-practice-app","last_synced_at":"2025-05-07T10:38:14.552Z","repository":{"id":283323695,"uuid":"950086554","full_name":"ew-code/pw-practice-app","owner":"ew-code","description":"This repository demonstrates the setup and execution of UI end-to-end tests using Playwright and TypeScript. More information can be found in the README.md file, and detailed test scenarios are described in the TESTS.md file.","archived":false,"fork":false,"pushed_at":"2025-04-10T17:03:40.000Z","size":14931,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T18:48:06.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ew-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2025-03-17T15:57:46.000Z","updated_at":"2025-04-10T17:03:43.000Z","dependencies_parsed_at":"2025-03-19T17:34:16.063Z","dependency_job_id":null,"html_url":"https://github.com/ew-code/pw-practice-app","commit_stats":null,"previous_names":["ew-code/pw-practice-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ew-code%2Fpw-practice-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ew-code%2Fpw-practice-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ew-code%2Fpw-practice-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ew-code%2Fpw-practice-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ew-code","download_url":"https://codeload.github.com/ew-code/pw-practice-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252861082,"owners_count":21815613,"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-05-07T10:38:12.320Z","updated_at":"2025-05-07T10:38:14.529Z","avatar_url":"https://github.com/ew-code.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PLaywright practice app tests\n\nThis project is based on **Playwright v1.51.1** and demonstrates the setup of end-to-end tests with Playwright and additional tools like Faker.js for dynamic test data generation.\n\nYou can find the full Playwright documentation [here](https://playwright.dev/).\n\n## Prerequisites\n\n- Node.js and npm\n\n## Task Execution Steps:\n\n### 1. Clone the Repository\n\nStart by cloning the repository to your local machine:\n\n```bash\ngit clone https://github.com/bondar-artem/pw-practice-app.git\ncd pw-practice-app\n```\n\n### 2. Prepare Environment Variables\n\nCreate the .env.example file and rename it to .env:\n\n```bash\ncp .env.example .env\n```\n\nUpdate any environment variables in the .env file if necessary.\n\nOptional: If environment variable management is required, install dotenv as a development dependency:\n\n```bash\nnpm install -D dotenv\n```\n\n### 3. Install Dependencies\n\nInstall the required dependencies for the project:\n\n```bash\nnpm install\n```\n\nIf you encounter warnings related to peer dependencies such as:\n\n```bash\nnpm WARN ERESOLVE overriding peer dependency\nnpm WARN While resolving: @angular/cdk@12.1.0\nnpm WARN Found: @angular/common@14.3.0\n```\n\nYou can force the installation by running:\n\n```bash\nnpm install --force\n```\n\n### 4. Install Playwright Test Runner\n\nInstall the Playwright Test runner as a development dependency:\n\n```bash\nnpm install --save-dev @playwright/test\n```\n\nInitialize Playwright in the project (use --force to overwrite any existing configuration if necessary):\n\n```bash\nnpm init playwright@latest --force\n```\n\nInstall the required browsers for Playwright:\n\n```bash\nnpx playwright install\n```\n\n### 5. Install Faker.js Library\n\nTo generate fake data in tests, install the @faker-js/faker library as a development dependency:\n\n```bash\nnpm install --save-dev @faker-js/faker\n```\n\nThis library allows you to generate random data such as names, emails, and addresses — useful for testing input fields and dynamic scenarios.\n\n### 6. Run the Application\n\nIf your project requires running the app locally, you can start it using:\n\n```bash\nnpm run start\n```\n\nTo stop the application, press:\n\n```bash\nCtrl + C\n```\n\n### 7. Implement and Refactor Tests\n\n- Create Page Objects using the Page Object Model (POM) pattern and write your first test.\n- Refactor the tests to improve readability, modularity, and maintainability.\n- Utilize environment variables and Faker.js for dynamic test data generation.\n\n### Running Tests\n\nAfter setup, you can run your tests using the Playwright test runner:\n\n```bash\nnpx playwright test\n```\n\nYou can also run tests in headed mode or with trace/viewer mode:\n\n```bash\nnpx playwright test --headed\nnpx playwright show-report\n```\n\n### Test Data, Factories, and Models\n\nThis project uses the following approaches to manage test data and improve test maintainability:\n\n1. **Factories**:\n   - Factories are used to generate dynamic test data for various scenarios.\n   - Example: Creating user profiles with randomized names, emails, and addresses using `@faker-js/faker`.\n\n2. **Models**:\n   - Models represent the structure of data used in the application.\n   - Example: A `UserModel` defines the properties of a user, such as `name`, `email`, and `password`.\n\n3. **Test Data**:\n   - Static and dynamic test data is stored in a structured way to ensure consistency across tests.\n   - Example: Login credentials are stored in a `test-data` file for reuse in multiple tests.\n\n## Test Cases\n\nFor the purpose of the recruitment process, a separate file `TESTS.md` has been added. This file contains detailed descriptions of all implemented test cases, including their purpose, steps, and expected outcomes.\n\nYou can find the test case details in the [TESTS.md](./TESTS.md) file.\n\n\n-------------------------------------------------------\n#### Ngx-Admin Angular 14 application from akveo.com\n\nThis is a modified and more lightweight version of the original application to practice UI Automation with Playwright.\n\nThe original repo is here: [https://github.com/akveo/ngx-admin](https://github.com/akveo/ngx-admin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Few-code%2Fpw-practice-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Few-code%2Fpw-practice-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Few-code%2Fpw-practice-app/lists"}