shopware-e2e-testkit
v1.0.0
Published
Shopware 6 E2E Smoke Testkit
Readme
Shopware 6 E2E Smoke Testkit
A ready-to-use E2E/smoke testkit for Shopware 6 Storefront, based on Playwright.
Features
- ✅ Quick setup with
initcommand. - ✅ Pre-configured smoke tests for core storefront functionality.
- ✅ Page Object Model (POM) based architecture for easy maintenance.
- ✅ Configurable via environment variables.
Installation
npm install --save-dev shopware-e2e-testkitGetting Started
1. Initialize the testkit
Run the following command in your project root:
npx shopware-testkit initThis will create:
playwright.config.ts: Playwright configuration..env: Environment variables for your shop URL..env.example: Template for environment variables.
2. Configure your Shop URL
Open the .env file and set your SALESCHANNEL_URL:
SALESCHANNEL_URL=https://your-shopware-6-store.com3. Run the tests
npx shopware-testkit runYou can also specify the URL directly via CLI:
npx shopware-testkit run --url https://another-store.comDebugging
You can debug the tests using standard Playwright features:
UI Mode: Opens an interactive UI to step through tests.
npx shopware-testkit run --uiDebug Mode: Opens the Playwright Inspector.
npx shopware-testkit run --debug
Continuous Integration (Bitbucket Pipelines)
To run the smoke tests automatically in your Bitbucket Pipelines, you can add a step to your bitbucket-pipelines.yml.
Example Configuration
Using the official Playwright Docker image ensures all browser dependencies are met. You can add this as a separate step in your pipeline:
pipelines:
default:
- step:
name: Shopware E2E Smoke Tests
image: mcr.microsoft.com/playwright:v1.49.1-jammy
caches:
- node
script:
- npm ci
# The testkit picks up SALESCHANNEL_URL and SEARCH_TERM from the environment
- npx shopware-testkit run
artifacts:
- playwright-report/**
# Manual trigger for specific environment
custom:
smoke-tests-staging:
- step:
name: Shopware E2E Smoke Tests (Staging)
image: mcr.microsoft.com/playwright:v1.49.1-jammy
script:
- npm ci
- SALESCHANNEL_URL="https://staging.yourshop.com" npx shopware-testkit runEnvironment Variables
Make sure to define the following Repository Variables in Bitbucket (Repository settings > Pipelines > Repository variables):
SALESCHANNEL_URL: The URL of your Shopware storefront (e.g.,https://staging.yourshop.com).SEARCH_TERM: (Optional) The product name to search for.
Included Tests
The smoke testkit covers:
- Homepage: Verifies that the home page loads and essential elements (logo, navigation, footer) are visible.
- Search: Verifies that the search functionality returns results.
- Product Detail Page (PDP): Verifies that product details and price are displayed.
- Cart: Verifies that products can be added to the cart.
- Checkout: Verifies the guest checkout flow until the confirmation page (without placing an actual order).
License
MIT
