{"id":24664475,"url":"https://github.com/shane-reaume/pytest-playwright-learn-to-code","last_synced_at":"2026-05-20T04:33:54.189Z","repository":{"id":274123081,"uuid":"920192709","full_name":"shane-reaume/pytest-playwright-learn-to-code","owner":"shane-reaume","description":"This is an evolving project that explores innovative ways to learn Python interactively, specifically targeting Python QA engineers and developers who want to learn pytest. The project combines fun interactive learning with real-world testing scenarios.","archived":false,"fork":false,"pushed_at":"2025-01-26T05:22:37.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T09:47:49.782Z","etag":null,"topics":["playwright","pytest","python","study-aid"],"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/shane-reaume.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-01-21T18:12:32.000Z","updated_at":"2025-01-26T05:22:40.000Z","dependencies_parsed_at":"2025-01-25T03:34:21.972Z","dependency_job_id":null,"html_url":"https://github.com/shane-reaume/pytest-playwright-learn-to-code","commit_stats":null,"previous_names":["shane-reaume/pytest-playwright-learn-to-code"],"tags_count":0,"template":false,"template_full_name":"shane-reaume/pytest-playwright-template","purl":"pkg:github/shane-reaume/pytest-playwright-learn-to-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shane-reaume%2Fpytest-playwright-learn-to-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shane-reaume%2Fpytest-playwright-learn-to-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shane-reaume%2Fpytest-playwright-learn-to-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shane-reaume%2Fpytest-playwright-learn-to-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shane-reaume","download_url":"https://codeload.github.com/shane-reaume/pytest-playwright-learn-to-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shane-reaume%2Fpytest-playwright-learn-to-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33245814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T04:32:20.885Z","status":"ssl_error","status_checked_at":"2026-05-20T04:31:26.238Z","response_time":356,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["playwright","pytest","python","study-aid"],"created_at":"2025-01-26T06:13:12.990Z","updated_at":"2026-05-20T04:33:54.173Z","avatar_url":"https://github.com/shane-reaume.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Learning and Testing with Pytest-Playwright\n\n![Interactive Python Learning Example](02_data_types_example.png)\n\n🚧 Work in Progress 🚧 01 - 03 tests complete\n\u003cbr\u003e\n\u003cbr\u003e\n This is an evolving project that explores innovative ways to learn Python interactively, specifically targeting Python QA engineers and developers who want to learn pytest. The project combines fun interactive learning with real-world testing scenarios in a CLI environment.\n\n## Template repo for creating your own pytest-playwright project\n\n- [pytest-playwright-template](https://github.com/shane-reaume/pytest-playwright-template)\n- This framework is built on top of the [pytest-playwright](https://github.com/microsoft/playwright-pytest) project, recommended by Playwright.\n- We customized syntax with `describe` and `it` to make it more readable and easier to understand for those coming from other JavaScript based testing frameworks.\n\n## Features\n\n- **Interactive Learning**: Learn Python through interactive CLI-based lessons\n  * Syntax highlighting with customizable themes\n  * Clear, consistent formatting for better readability\n  * Immediate feedback on exercises\n  * Progress tracking and key takeaways\n- **Python Learning Examples**: Comprehensive test examples covering Python fundamentals to advanced concepts\n- **Playwright Integration**: Browser automation examples using Playwright\n- **Test-Driven Learning**: Learn Python concepts through practical test cases\n- **Modern Python Setup**: Uses `pyproject.toml` for dependency management and configuration\n- **Code Quality Tools**: Integrated Ruff for linting and code formatting\n\n## Project Structure\n\n```\npytest-playwright-learn-to-code/\n├── tests/\n│   ├── interactive_examples/    # Interactive learning modules\n│   │   ├── 01_basics.py        # Interactive Python basics\n│   │   └── ... more lessons\n│   ├── test_examples/          # Real-world test examples\n│   │   ├── test_01_basics.py   # Basic Python concepts\n│   │   ├── test_02_data_types.py\n│   │   └── ... more examples\n│   └── conftest.py            # Shared fixtures and configurations\n├── scripts.py                  # Test runner script\n├── pyproject.toml             # Project configuration and dependencies\n└── README.md                  # Project documentation\n```\n\n## Setup Requirements\n\n### Common Requirements\n- Python 3.8 or higher\n- pip (Python package installer)\n- Git\n\n### OS-Specific Requirements\n\n#### Linux (Debian/Ubuntu/Linux Mint)\n1. Install Python and required system packages:\n   ```bash\n   sudo apt update\n   sudo apt install python3 python3-pip python3-venv git\n   ```\n\n2. Install additional dependencies for Playwright:\n   ```bash\n   sudo apt install libavif16\n   ```\n\n   Note: On some systems, you might need additional dependencies. If you encounter issues, run:\n   ```bash\n   sudo apt install libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \\\n   libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2\n   ```\n\n#### macOS\n1. Install Homebrew (if not already installed):\n   ```bash\n   /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n   ```\n\n2. Install Python:\n   ```bash\n   brew install python\n   ```\n\n#### Windows\n1. Download and install Python from [python.org](https://www.python.org/downloads/)\n   - During installation, make sure to check \"Add Python to PATH\"\n   - Choose the option to install pip\n\n2. Install Git from [git-scm.com](https://git-scm.com/download/win)\n\n## Installation Steps\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/shane-reaume/pytest-playwright-learn-to-code.git\n   cd pytest-playwright-learn-to-code\n   ```\n\n2. Create and activate a virtual environment:\n\n   **Linux/macOS**:\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate\n   ```\n\n   **Windows**:\n   ```cmd\n   python -m venv venv\n   venv\\Scripts\\activate\n   ```\n\n3. Install the project with development dependencies:\n\n   **Linux/macOS**:\n   ```bash\n   pip3 install -e \".[dev]\"\n   ```\n\n   **Windows**:\n   ```cmd\n   pip install -e \".[dev]\"\n   ```\n\n4. Install Playwright browsers:\n   ```bash\n   playwright install\n   ```\n\n## Development Tools\n\n### Code Quality\n\nThe project uses Ruff for linting and code formatting. Ruff is automatically installed with the development dependencies.\n\nTo run Ruff:\n```bash\nruff check .     # Check for issues\nruff format .    # Format code\n```\n\n## Running Tests\n\nUse the `scripts.py` command-line interface:\n\n### Available Commands\n\n- Run all tests:\n  ```bash\n  python3 scripts.py run all\n  ```\n\n- Run interactive lessons:\n  ```bash\n  python3 scripts.py run interactive\n  ```\n\n- Run test examples:\n  ```bash\n  python3 scripts.py run test_examples\n  ```\n\n### Test Options\n\nAdd these flags to any test command:\n\n- `--headed`: Run tests in headed mode (visible browser)\n  ```bash\n  python3 scripts.py run all --headed  # Linux/macOS\n  python scripts.py run all --headed   # Windows\n  ```\n\n- `--debug`: Run tests in debug mode (slower execution)\n  ```bash\n  python3 scripts.py run all --debug  # Linux/macOS\n  python scripts.py run all --debug   # Windows\n  ```\n\n### Help\n\nTo see all available commands and options:\n```bash\npython3 scripts.py help  # Linux/macOS\npython scripts.py help   # Windows\n```\n\n## Learning Paths\n\n### Interactive Learning (Recommended for Beginners)\n\nStart with the interactive learning path for a hands-on experience:\n\n```bash\n# Run the interactive Python basics lesson\npython3 scripts.py run interactive_basics  # Linux/macOS\npython scripts.py run interactive_basics   # Windows\n\n# Run all interactive lessons\npython3 scripts.py run interactive         # Linux/macOS\npython scripts.py run interactive          # Windows\n```\n\nThe interactive lessons will:\n- Present concepts one at a time\n- Ask you questions about what you're learning\n- Provide immediate feedback\n- Give helpful explanations\n- Show key takeaways at the end of each lesson\n\n#### Theme Selection\n\nWhen you start your first interactive lesson, you'll be prompted to choose a syntax highlighting theme. Available themes include:\n- Monokai (default) - Dark theme with vibrant colors\n- One Dark - Atom-inspired dark theme\n- Solarized (dark/light) - Popular theme with carefully chosen colors\n- Dracula - Modern dark theme\n- Gruvbox (dark/light) - Retro groove theme\n- Nord - Arctic-inspired dark theme\n- VS - Visual Studio-inspired light theme\n- Zenburn - Low contrast dark theme\n\nYour theme choice persists across all interactive lessons in the same session, providing a consistent learning experience.\n\n### Test Examples\n\nThe `test_examples` directory contains real-world testing scenarios that demonstrate both Python concepts and testing practices:\n\n1. Python Basics (`test_01_basics.py`)\n2. Data Types (`test_02_data_types.py`)\n3. Control Flow (`test_03_control_flow.py`)\n4. Functions (`test_functions.py`)\n5. Object-Oriented Programming Basics (`test_oop_basics.py`)\n6. Advanced OOP Concepts (`test_advanced_oop.py`)\n7. Modules and Packages (`test_modules_and_packages.py`)\n8. File I/O (`test_file_io.py`)\n9. Exception Handling (`test_exceptions_handling.py`)\n10. Advanced Concepts (`test_advanced_concepts.py`)\n11. Decorators and Context Managers (`test_decorators_and_context_managers.py`)\n12. Iterators and Generators (`test_iterators_and_generators.py`)\n13. Standard Library and Third-Party Packages (`test_standard_library_and_third_party.py`)\n14. Pytest Basics (`test_pytest_basics.py`)\n15. Playwright Integration (`test_playwright_integration.py`)\n\nEach test file contains practical examples and test cases that demonstrate both Python concepts and testing best practices in action.\n\n## Troubleshooting\n\n### Linux\n- If you see \"command not found: python\", use `python3` instead\n- If you encounter browser launch issues, make sure all system dependencies are installed\n- For permission issues with `/usr/bin/env: 'python': No such file or directory`, try:\n  ```bash\n  sudo ln -s /usr/bin/python3 /usr/bin/python\n  ```\n\n### macOS\n- If you see \"command not found: python\", try `python3` or reinstall Python using Homebrew\n- For M1/M2 Macs, you might need Rosetta 2 for some browser features:\n  ```bash\n  softwareupdate --install-rosetta\n  ```\n\n### Windows\n- If Python/pip is not recognized, verify that Python is added to PATH\n- For permission issues, try running Command Prompt as Administrator\n- If you see SSL errors, you might need to install certificates:\n  ```cmd\n  python -m pip install --upgrade certifi\n  ```\n\n## Contributing\n\nFeel free to submit issues and enhancement requests!\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshane-reaume%2Fpytest-playwright-learn-to-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshane-reaume%2Fpytest-playwright-learn-to-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshane-reaume%2Fpytest-playwright-learn-to-code/lists"}