Skip to content

Ewerall/PlaywrightDemoblaze

Repository files navigation

Playwright Automation Testing for Demoblaze

RU

Playwright Python pytest Allure Report GitHub Actions

Automated testing for the Demoblaze web application:

  • 26+ parameterized tests with full functional coverage
  • End-to-End scenarios simulating real user interactions
  • Advanced wait strategies for "complex" web applications
  • Integration with Allure Report and GitHub Actions CI/CD

Implementation Features

  • Robust Page Object Model
    Adapted for sites with poor layout and dynamic loading
  • Combined waiting strategies
    Mix of network waits, custom JS checks, and dialog handling
  • Test data parameterization
    Realistic profile generation using Faker
  • Professional Allure integration
    Detailed reports with epics, features, and stories
  • State management
    Fixtures for cart cleanup and test isolation
PlaywrightDemoblaze
├── .github/              # CI/CD configuration
├── data/                 # Test data generators
├── pages/                # Page Object Model implementation
├── tests/                # 26+ parameterized tests
├── conftest.py           # Fixtures and configuration
├── pytest.ini            # Pytest settings
└── requirements.txt      # Dependencies

Tech Stack

Category Stack
Core Python 3.10+, Playwright, Pytest
Patterns Page Object Model (POM)
Reporting Allure Framework, Allure-pytest
CI/CD GitHub Actions, Allure Report CI
Utilities Faker (data generation)

Run Tests

# Install dependencies
pip install -r requirements.txt
playwright install

# Run all tests
pytest --alluredir=allure-results

# Run specific test group
pytest tests/test_e2e.py -v

# Generate Allure report
allure serve allure-results

Allure-reports

Latest Allure Report from Github actions

Test Cases

Testing Type Example Scenarios Count
End2End Registration → Product Selection → Payment 1+
Home page Categories, carousel, pagination 3+
Product page Data validation, add to cart 2+
Cart page Total calculation, item removal, checkout 1+
Users Registration, login, feedback 2+
Invalid Registration, login, feedback, Payment 4+

Technical Challenges Solved

  1. Handling "fragile" elements
    Custom explicit waits for dynamically loaded content:
with  self.page.expect_response(lambda  response: '/pagination'  in  response.url  and  response.status  ==  200):
        self.page.locator(direction).click()
self.page.wait_for_function("""
	() => {
            const container = document.querySelector('#tbodyid');
            return container && container.children.length > 0;
        }
""", timeout=10000)
expect(self.page.locator("#tbodyid .col-lg-4").first).to_be_visible(timeout=10000)
  1. Dialog and alert handling
    Specialized handlers for modal windows:
with page.expect_event("dialog") as dialog_info:
    page.locator(ADD_BUTTON).click()
dialog = dialog_info.value
dialog.accept()
  1. Network explicit wait
    Monitoring API requests during actions:
with  self.page.expect_response("**/bycat") as  response_info:
	self.page.click(f'a:has-text("{category}")')
response  =  response_info.value
assert  response.status  ==  200

Sample Run in Headed Mode

playwright_headed_tests.mp4

Releases

No releases published

Packages

No packages published

Languages