The VirtoCommerce Testing Module is an enterprise-grade test automation framework that ensures the quality, reliability, and performance of the VirtoCommerce e-commerce platform. This comprehensive testing solution provides:
- 80 Automated Tests across GraphQL APIs, end-to-end UI workflows, and platform integration scenarios
- Multi-Browser Support for Chromium, Firefox, and WebKit ensuring cross-browser compatibility
- Type-Safe Development with auto-generated GraphQL client types for robust API testing
- CI/CD Integration with GitHub Actions for continuous quality assurance
- Flexible Configuration supporting multiple checkout flows and UI control variations
The framework leverages modern technologies (Playwright + Python + Pytest) to deliver fast, reliable, and maintainable test automation that scales with the VirtoCommerce platform.
Duration: 90-120 minutes
Framework: Playwright + Python + Pytest
Project: vc-testing-module
This onboarding session will equip developers with everything needed to work with the VirtoCommerce E2E test automation project. We'll cover the complete workflow from initial setup through writing and running tests, with hands-on exercises throughout. By the end, each developer will have a working environment and understand how to work with both GraphQL functional tests and E2E visual tests.
- Setting up the complete test automation environment
- Understanding the multi-layer testing architecture (GraphQL, E2E, WebAPI)
- Writing and executing tests with custom configuration options
- Debugging test failures and using Playwright's powerful tools
- Following best practices for test development and maintenance
- Integrating tests into the CI/CD pipeline
The VirtoCommerce Testing Module ensures platform quality through comprehensive automated testing:
Primary Objectives:
- Validate critical business workflows (cart, checkout, order management)
- Ensure API contract compliance and data integrity
- Verify UI functionality across multiple browsers and configurations
- Enable rapid feedback during development and deployment
- Prevent regressions and maintain platform stability
Business Value:
- Reduced Time-to-Market - Automated tests provide fast feedback for faster releases
- Increased Confidence - Comprehensive coverage ensures platform reliability
- Cost Efficiency - Early bug detection reduces expensive production fixes
- Scalability - Framework grows with platform features and complexity
Two Primary Test Suites:
- GraphQL Functional Tests (54 tests) - Fast API-level validation of business logic
- E2E Visual Tests (25 tests) - Complete user journey validation with real browsers
Coverage Areas:
- Cart operations, checkout flows, payment processing
- Catalog search, product discovery, category navigation
- Order management, tracking, and history
- User authentication, authorization, and organization management
- Multi-language support and localization
- Address management and shipping calculations
Our framework includes flexible configuration options:
--checkout-mode- Test single-page or multi-step checkout flows--product-quantity-control- Test stepper or button quantity controls--show-browser- Visual debugging with browser UI
- Ask questions anytime during the session
- Hands-on exercises throughout
- Follow-up support available after onboarding
- Python 3.7+ installed
- Git access to the repository
- Cursor AI (recommended) or PyCharm
- pip (Python package manager)
-
Clone the repository
git clone https://github.com/VirtoCommerce/vc-testing-module cd vc-testing-module -
Create and activate virtual environment
python -m venv .venv source .venv/bin/activate # On macOS/Linux .venv\Scripts\activate # On Windows
-
Install dependencies
python -m pip install --upgrade pip pip install -r requirements.txt
-
Install pre-commit hooks
⚠️ Importantpre-commit install
Note: This includes Black formatter and must be done manually for Git security
-
Install Playwright browsers
playwright install
-
Verify installation
python -c "import playwright; print(playwright.__version__)" -
Environment configuration
- Create
.envfile for secrets:
TOKEN=your_auth_token_here
- Create
-
Add test data (optional)
python -m dataset.dataset_seeder
Hands-on: Everyone sets up their environment (15 min)
vc-testing-module/
├── tests_graphql/ # Functional GraphQL API tests
│ └── tests/
├── tests_e2e/ # Visual E2E browser tests
│ └── tests/
├── graphql_client/ # GraphQL client and code generation
├── dataset/ # Test data seeding
├── .env # Environment variables (create this)
├── requirements.txt # Python dependencies
└── README.md # Project documentation
requirements.txt- Python dependencies.env- Authentication tokens and secretsconftest.py- Shared fixtures and custom pytest optionsgraphql_client/python_graphql_codegen.py- Generate GraphQL types
- GraphQL tests (
tests_graphql/) - API functional testing - E2E tests (
tests_e2e/) - Full browser UI testing
# Run all GraphQL tests
pytest -v -s tests_graphql/tests/
# Run specific test
pytest tests_graphql/tests/test_graphql_add_variation_to_cart.py -k test_add_variation_to_cart
# Run with detailed output
pytest tests_graphql/tests/test_graphql_add_variation_to_cart.py::test_add_variation_to_cart -v -s# Run E2E tests (default: headless)
pytest tests_e2e/tests/ -v -s
# Run with visible browser
pytest tests_e2e/tests/ -v -s --show-browser# Specify browser (chromium, firefox, webkit)
pytest --browser=chromium
pytest --browser=firefoxOur project has special custom options:
1. Checkout Mode (single-page or multi-step)
pytest tests_e2e/tests/ --checkout-mode single-page # default
pytest tests_e2e/tests/ --checkout-mode multi-step2. Product Quantity Control (stepper or button)
pytest tests_e2e/tests/ --product-quantity-control stepper # default
pytest tests_e2e/tests/ --product-quantity-control button3. Show Browser (headed mode)
pytest tests_e2e/tests/ --show-browser# Test with multi-step checkout, button controls, and visible browser
pytest tests_e2e/tests/ --checkout-mode multi-step --product-quantity-control button --show-browser# Slow motion (500ms delay between steps)
pytest --headed --slowmo=500
# Debug mode
pytest --headed --debugDemo: Run tests with different configurations (10 min)
def test_example(pytestconfig):
# Get custom options
checkout_mode = pytestconfig.getoption("--checkout-mode")
product_quantity_control = pytestconfig.getoption("--product-quantity-control")
show_browser = pytestconfig.getoption("--show-browser")
print(f"Checkout mode: {checkout_mode}")
print(f"Product quantity control: {product_quantity_control}")
print(f"Show browser: {show_browser}")
# Use these values to adapt test behavior
if checkout_mode == "multi-step":
# Test multi-step flow
passimport os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("TOKEN")
def test_with_auth():
# Use TOKEN for authentication
passdef test_add_product_to_cart(graphql_client):
# Arrange - Prepare test data
product_id = "test-product-123"
# Act - Execute GraphQL mutation
response = graphql_client.add_to_cart(product_id, quantity=1)
# Assert - Verify results
assert response.success is True
assert len(response.cart.items) > 0def test_checkout_flow(page, pytestconfig):
checkout_mode = pytestconfig.getoption("--checkout-mode")
# Navigate to product
page.goto("https://example.com/product")
# Add to cart
page.click("#add-to-cart")
# Go to checkout
page.click("#checkout-button")
# Adapt based on checkout mode
if checkout_mode == "single-page":
# Fill all fields on one page
page.fill("#email", "test@example.com")
page.fill("#address", "123 Main St")
else:
# Multi-step flow
page.fill("#email", "test@example.com")
page.click("#next-step")
page.fill("#address", "123 Main St")
# Complete order
page.click("#place-order")
# Assert
assert page.locator(".order-confirmation").is_visible()- Use data-test-id attributes when available
- Prefer role-based selectors:
page.get_by_role("button", name="Submit") - Avoid brittle selectors that break with CSS changes
Hands-on: Write a simple test together (10 min)
# Regenerate GraphQL types from schema
python graphql_client/python_graphql_codegen.py -s -v# Seed test data
python -m dataset.dataset_seeder# Record actions and generate test code
playwright codegen example.comDemo this tool - it's incredibly useful!
- Automatically formats code with Black
- Runs linting checks
- Ensures code quality before commits
- Pre-commit hooks enforce formatting (Black)
- Follow existing test patterns
- Keep tests independent
- Use meaningful test names
- GraphQL tests - Fast API testing, business logic validation
- E2E tests - User journey testing, visual validation, integration flows
- Forgetting to activate virtual environment
- Not installing pre-commit hooks
- Hard-coding values instead of using custom options
- Missing
.envfile for authentication
- Always test with different
--checkout-modevalues - Test with different
--product-quantity-controlvalues - Use
--show-browserwhen debugging
- How tests run in CI/CD pipeline
- Configuration for different environments
- Viewing test results
- When tests block deployments
- Project README: https://github.com/VirtoCommerce/vc-testing-module
- Playwright Docs: https://playwright.dev/python/
- Pytest Docs: https://docs.pytest.org/
- Team communication channels
- Code review process
- VirtoCommerce testing team
- Open floor for questions
- Assignment: Write your first test (GraphQL or E2E)
- Schedule follow-up session
- Feedback on onboarding process
- Complete environment setup (including pre-commit hooks!)
- Run GraphQL test suite successfully
- Run E2E tests with different custom options
- Create
.envfile with necessary tokens - Write one test (GraphQL or E2E) for an assigned feature
- Test with both
--checkout-modeoptions - Submit first test for code review
# Setup (one-time)
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pre-commit install
playwright install
# Run tests
pytest -v -s tests_graphql/tests/ # GraphQL tests
pytest tests_e2e/tests/ --show-browser # E2E with browser visible
pytest tests_e2e/tests/ --checkout-mode multi-step --show-browser
# Utilities
python graphql_client/python_graphql_codegen.py -s -v # Generate types
python -m dataset.dataset_seeder # Seed data
playwright codegen example.com # Record testsHappy Testing! 🚀