{"id":24573899,"url":"https://github.com/dmberezovskyii/pytest-python-selenium-framework","last_synced_at":"2025-04-23T11:57:39.119Z","repository":{"id":190694251,"uuid":"683072416","full_name":"dmberezovskyii/pytest-python-selenium-framework","owner":"dmberezovskyii","description":"Sample framework with python, selenium and pytest, using CI GitHub Actions and Poetry","archived":false,"fork":false,"pushed_at":"2025-02-27T06:57:43.000Z","size":34072,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T11:57:27.348Z","etag":null,"topics":["cipher","cryptography","github-actions","page-object-model","page-object-python-selenium","poetry","poetry-selenium-pytest","pom","pom-python-selenium-pytest","python-pytest-selenium-framework","python-selenium-automation","python-selenium-pytest-ci","python3","python3-selenium-pytest","security","selenium","selenium-pytest","selenium-python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/dmberezovskyii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-08-25T14:28:33.000Z","updated_at":"2025-03-18T12:55:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"6876985a-15b9-44d2-8ade-551326f8b617","html_url":"https://github.com/dmberezovskyii/pytest-python-selenium-framework","commit_stats":null,"previous_names":["dimaberezovskyi/simple-python-selenium-framework","dmberezovskyii/pytest-python-selenium-framework"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmberezovskyii%2Fpytest-python-selenium-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmberezovskyii%2Fpytest-python-selenium-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmberezovskyii%2Fpytest-python-selenium-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmberezovskyii%2Fpytest-python-selenium-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmberezovskyii","download_url":"https://codeload.github.com/dmberezovskyii/pytest-python-selenium-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250430589,"owners_count":21429323,"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":["cipher","cryptography","github-actions","page-object-model","page-object-python-selenium","poetry","poetry-selenium-pytest","pom","pom-python-selenium-pytest","python-pytest-selenium-framework","python-selenium-automation","python-selenium-pytest-ci","python3","python3-selenium-pytest","security","selenium","selenium-pytest","selenium-python"],"created_at":"2025-01-23T20:39:53.194Z","updated_at":"2025-04-23T11:57:39.113Z","avatar_url":"https://github.com/dmberezovskyii.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Simple Python Selenium UI Automation Framework\n\nA simple UI automation framework built with:\n- **Python**: 3.9 - 3.12\n- **pytest**: 8.3.0\n- **Selenium**: 4.24.0\n- **CI**: GitHub Actions\n\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue)](https://www.linkedin.com/in/dmytro-berezovskyi/)\n\n## Features\n\n- User-friendly UI automation framework.\n- Built on popular Python libraries: pytest and Selenium.\n- Supports **Chrome**, **Firefox**, and **Remote** browsers for UI testing.\n- Utilities for setting up and managing WebDriver instances.\n- Integrated with **GitHub Actions** CI workflow for Darwin (Mac) and Linux.\n- Supports multiple environments: **dev**, **stage**.\n- Generates **pytest reports** and **custom logs**.\n- Secure Secrets Handling: Sensitive data like passwords are encrypted and stored securely.\n- Test Data Management: Integrated with YAML files for test data storage and access.\n\n## Getting Started\n\n### Prerequisites\n\n- If you're not using macOS with ARM64 architecture or a Selenium version below 4.24.0, please upload the appropriate driver corresponding to your OS to the `resources` directory.\n\n### Local Usage\n\n1. Clone this repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   ```\n2. Install required dependencies:\n   ```bash\n   pip install poetry\n   poetry shell\n   poetry env info\n   copy `Executable: path to virtual env` -\u003e Add Interpreter -\u003e Poetry Environment -\u003e Existing environment -\u003e add Executable -\u003e Apply\n   poetry install\n   ```\n   then specify your poetry env\n3. Create a `.env` file and add:\n   ```plaintext\n   DEV_URL = \"your-dev-project-url\"\n   STAG_URL = \"your-staging-project-url\"\n   ```\n\n4. If you prefer not to use environment variables, add your references to the properties file:\n   ```python\n   class Properties:\n       _ENV_VARIABLES = {\n           \"dev\": (\"DEV_URL\", \"\"),\n           \"stag\": (\"STAG_URL\", \"\"),\n           # Add more environments and their default URLs as needed\n       }\n   ```\n    \n### Latest Drivers\n- #### You can download the chrome driver with CLI util [util](utils/driver_management.md)\n- #### [Chrome Drivers](https://googlechromelabs.github.io/chrome-for-testing/#stable)\n- #### [Firefox Drivers](https://github.com/mozilla/geckodriver)\n\n\n### CI: GitHub Actions\n\n#### *Important Notes*\n\n- When running CI locally, ensure your Git resources contain the correct Chrome driver with x86_64 architecture (unless using Selenium version 4.24.0 or higher).\n- Go to **Repository Settings** -\u003e **Secrets and Variables** -\u003e **Actions** -\u003e **Variables**, and add `DEV_URL`, `STAG_URL`.\n- CI configuration is available for running tests on Ubuntu in `run_test_ubuntu.yaml`.\n- ```\n   jobs:\n      selenium-tests:\n        runs-on: macos-latest\n        env:\n          DEV_URL: ${{ vars.DEV_URL }}\n          STAG_URL: ${{ vars.STAG_URL }}\n   ```\n\n### Local: Ruff Lint Configuration\n\nThe linting configuration defines rules that dictate the checks performed. Customize these rules to suit your project's coding style and requirements.\n\n1. Create external tools to run linting.\n2. Set the working directory to:\n   ```plaintext\n   $ProjectFileDir$\n   ```\n3. Specify the program:\n   ```plaintext\n   path to your ruff installed /bin/ruff \n   ```\n4. Provide the arguments:\n   ```plaintext\n   $FilePathRelativeToProjectRoot$ --config .ruff.toml\n   ```\n### Secrets\nTo secure our passwords or sensitive data, we store them in an encrypted form. For this, we use the [secure-test-automation](https://pypi.org/project/secure-test-automation/) library.\nimplementation on framework side: utils/crypto.py\n**Pay attention** The encryption key is stored in `/config/key.properties` (this file should be added to `.gitignore`) for local testing.  \nFor executing tests in remote environments (e.g., BrowserStack, Jenkins, etc.), we have integrated the Vault HashiCorp library.  \n\n```python\n@pytest.fixture\ndef get_password():\n    secure = Secure()\n    read = YAMLReader.read(\"data.yaml\", to_simple_namespace=True)\n    password = read.users.john.details.password\n    return secure.decrypt_password(password)\n```\n\n\n### Demo tool https://demoqa.com/text-box\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmberezovskyii%2Fpytest-python-selenium-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmberezovskyii%2Fpytest-python-selenium-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmberezovskyii%2Fpytest-python-selenium-framework/lists"}