{"id":27046929,"url":"https://github.com/nikita-filonov/python-ui-tests","last_synced_at":"2025-04-10T20:58:43.554Z","repository":{"id":286015309,"uuid":"960084965","full_name":"Nikita-Filonov/python-ui-tests","owner":"Nikita-Filonov","description":"This project serves as a reference implementation for writing clean, maintainable, and effective UI tests in Python using Playwright","archived":false,"fork":false,"pushed_at":"2025-04-08T16:38:07.000Z","size":5631,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T18:53:07.454Z","etag":null,"topics":["allure-report","best-practices","logging","playwright","playwright-python","pytest","python","test-automation","testing","ui-testing"],"latest_commit_sha":null,"homepage":"https://nikita-filonov.github.io/python-ui-tests/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nikita-Filonov.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-04-03T20:45:50.000Z","updated_at":"2025-04-08T16:38:28.000Z","dependencies_parsed_at":"2025-04-03T21:42:05.543Z","dependency_job_id":null,"html_url":"https://github.com/Nikita-Filonov/python-ui-tests","commit_stats":null,"previous_names":["nikita-filonov/python-ui-tests"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikita-Filonov%2Fpython-ui-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikita-Filonov%2Fpython-ui-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikita-Filonov%2Fpython-ui-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikita-Filonov%2Fpython-ui-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nikita-Filonov","download_url":"https://codeload.github.com/Nikita-Filonov/python-ui-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248298423,"owners_count":21080318,"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":["allure-report","best-practices","logging","playwright","playwright-python","pytest","python","test-automation","testing","ui-testing"],"created_at":"2025-04-05T06:19:36.381Z","updated_at":"2025-04-10T20:58:43.534Z","avatar_url":"https://github.com/Nikita-Filonov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python UI tests\n\n## Links\n\n- [Allure Report on GitHub Pages](https://nikita-filonov.github.io/python-ui-tests/13/index.html)\n- [GitHub Actions CI/CD](https://github.com/Nikita-Filonov/python-ui-tests/actions)\n- [UI Course Application](https://nikita-filonov.github.io/qa-automation-engineer-ui-course/#/auth/login) – The web\n  application being tested\n- [UI Course Repository](https://github.com/Nikita-Filonov/qa-automation-engineer-ui-course) – Source code for the UI\n  Course\n\n## Overview\n\nThis project provides an example of UI testing for a web application from\nthe [UI Course](https://nikita-filonov.github.io/qa-automation-engineer-ui-course/#/auth/login) using Python and\nPlaywright. The project demonstrates the usage of key technologies, design patterns, and best practices to ensure\nefficient, maintainable, and readable UI tests. Key features of this project include:\n\n- [Playwright](https://playwright.dev/python/) – A powerful browser automation tool for end-to-end testing.\n- [Pytest](https://docs.pytest.org/en/stable/) – A full-featured testing framework for Python.\n- [Allure](https://allurereport.org/) – A comprehensive test reporting framework that provides detailed and visually\n  appealing reports.\n- [PageObject](./pages) – To separate test logic from page-specific interaction logic, ensuring maintainable and\n  scalable tests.\n- [PageComponent](./components) – A custom pattern for abstracting and handling individual page components. This ensures\n  better modularity and reusability, improving the maintainability of the test code.\n- [PageFactory](./elements) – For creating and organizing page components dynamically and abstracting page details.\n- [Fixtures](./fixtures) – For reusable setup and teardown logic.\n- Logging and step-by-step reporting – Using custom loggers and Allure steps for better traceability.\n\nThe UI tests in this project cover key user journeys, such as user registration, and validate the presence and\nfunctionality of various page elements.\n\n## Setup Instructions\n\n### Prerequisites\n\nEnsure that you have the following installed on your system:\n\n- Python 3.11 or later\n- pip (Python package manager)\n- Git\n\n## Installation\n\nClone the repository and navigate to the project directory:\n\n```shell\ngit clone https://github.com/Nikita-Filonov/python-ui-tests.git\ncd python-ui-tests\n```\n\nCreate and activate a virtual environment:\n\n```shell\npython -m venv venv # Create virtual environment\nsource venv/bin/activate # Activate on macOS/Linux\nvenv\\Scripts\\activate # Activate on Windows\n```\n\nInstall dependencies:\n\n```shell\npip install --upgrade pip # Upgrade pip to the latest version\npip install -r requirements.txt # Install required dependencies\nplaywright install # Install playwright dependencies\n```\n\n## Running Tests\n\nTo run UI tests using pytest:\n\n```shell\npytest -m regression --numprocesses 2 # Run regression tests in parallel\n```\n\n## Generating Allure Reports\n\nRun tests and generate Allure results:\n\n```shell\npytest -m regression --alluredir=allure-results\n```\n\nTo serve the Allure report locally:\n\n```shell\nallure serve allure-results\n```\n\n## Running Tests in CI/CD\n\nTests are automatically executed in a CI/CD pipeline using [GitHub Actions](https://github.com/features/actions). The\nworkflow is configured to:\n\n- Run tests on every push and pull request to the main branch.\n- Generate and upload Allure reports as artifacts.\n- Publish the [Allure report](https://allurereport.org/) to [GitHub Pages](https://pages.github.com/) for easy access.\n\nEnsure that the [gh-pages](https://github.com/Nikita-Filonov/python-ui-tests/tree/gh-pages) branch exists in your\nrepository for successful deployment. If it does not exist, create it manually:\n\n```shell\ngit checkout --orphan gh-pages\n```\n\nThen push the new branch:\n\n```shell\ngit push origin gh-pages\n```\n\nTo allow GitHub Actions to publish the report, enable Workflow permissions:\n\n- Open your repository on GitHub.\n- Go to Settings \u003e Actions \u003e General.\n- Scroll down to Workflow permissions.\n- Select Read and write permissions.\n- Click Save.\n\nOnce set up, your tests will run automatically, and the Allure report will be deployed to GitHub Pages.\n\n## Accessing Allure Reports\n\nAfter a successful test run in CI/CD:\n\n- The Allure report will be available at [GitHub Pages](https://nikita-filonov.github.io/python-ui-tests/13/index.html).\n- The workflow logs and artifacts can be accessed\n  via [GitHub Actions](https://github.com/Nikita-Filonov/python-ui-tests/actions).\n- If the [*pages build and deployment*](https://github.com/Nikita-Filonov/python-ui-tests/actions/runs/14263348460)\n  workflow does not appear, verify your GitHub Pages settings:\n    - Go to Settings \u003e Pages.\n    - Under Build and deployment, ensure the source is set to the `gh-pages` branch.\n\n## Documentation for Used Actions\n\nFor detailed information on GitHub Actions used in this project, refer to the following:\n\n- [Checkout Action](https://github.com/actions/checkout)\n- [Setup Python Action](https://github.com/actions/setup-python)\n- [Upload Artifact Action](https://github.com/actions/upload-artifact)\n- [Download Artifact Action](https://github.com/actions/download-artifact)\n- [Allure Report Action](https://github.com/simple-elf/allure-report-action)\n- [GitHub Pages Deployment Action](https://github.com/peaceiris/actions-gh-pages)\n\n## Summary\n\nThis project serves as a reference implementation for writing clean, maintainable, and effective UI tests in Python\nusing Playwright. It showcases best practices such as using the Page Object and Page Factory patterns, structured\nlogging, and Allure reporting. The setup allows for easy test execution locally and in CI/CD environments, ensuring\nhigh-quality automated testing with minimal manual intervention.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikita-filonov%2Fpython-ui-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikita-filonov%2Fpython-ui-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikita-filonov%2Fpython-ui-tests/lists"}