Professional E2E test suite automating the Seznam.cz email workflow using Playwright and Python.
This test suite covers the critical business path (Happy Path) of sending an email via the Seznam.cz web client:
- Successfully log into a Seznam.cz email account (handling dynamic cookie/ad banners).
- Navigate directly to the mailbox and initialize a new email to a contact configured via
TEST_EMAIL. - Dynamically generate and attach a local text document (
test_attachment.txt). - Send the email and explicitly wait for the UI notification verifying successful delivery.
- Safely log out of the account via the profile menu.
As an E2E UI automation suite, coverage is focused on Functional Business Flows:
- UI Coverage: Login Page, Mailbox Dashboard, Email Composer Modal, File Upload Dialog, Success Notification, Logout Flow.
- Browser Coverage: Configured for Chromium (Headless mode in CI/CD pipeline, headed mode for local development).
- Resilience Coverage: Handles strict-mode violations, dynamic element locators, and conditional UI states (e.g., cookie banners).
- BDD Framework: Human-readable tests using Gherkin (
pytest-bdd). - Page Object Model (POM): Clean separation of test logic and UI locators.
- CI/CD Integrated: Automated test execution on every push via GitHub Actions.
- Security: Credential management using environment variables.
├── .github/workflows/
│ ├── demo-tests.yml # Gating CI: credential-free demo suite
│ └── tests.yml # Manual live Seznam suite (workflow_dispatch)
├── pages/ # Page Object Model classes (Seznam + the-internet demo)
├── tests/
│ ├── features/ # Gherkin: email_workflow.feature (@live), demo_the_internet.feature (@demo)
│ ├── step_definitions/ # BDD steps: test_email_steps.py, test_demo_steps.py
│ └── conftest.py # Playwright fixtures and setup
├── .env.example # Template for environment variables
├── pytest.ini # Pytest configuration
├── requirements.txt # Python dependencies
├── test_attachment.txt # Sample attachment used by the tests
└── README.md
- Python 3.10+
- Clone the repository:
git clone https://github.com/MilJav11/playwright-python-e2e-framework.git
cd playwright-python-e2e-framework- Configuration: copy
.env.exampleto.envin the root directory and fill in your credentials. Use a dedicated Seznam TEST account for this purpose. Never commit your.envfile — it is git-ignored. In CI/CD,TEST_EMAILandTEST_PASSWORDare read from repository secrets.
TEST_EMAIL=your_test_email@seznam.cz
TEST_PASSWORD=your_password
- Install dependencies:
pip install -r requirements.txt- Install Playwright browsers:
playwright install chromiumRuns against the public automation site https://the-internet.herokuapp.com (login, invalid password, file upload, logout). No credentials or .env required. This is the suite that gates CI.
pytest -m demo -vThe Seznam email scenario (@live) needs a dedicated test account (TEST_EMAIL / TEST_PASSWORD). It is run manually (GitHub Actions workflow_dispatch, or locally) because the third-party Seznam UI changes and can break the test independently of this code.
pytest -m live -v