Skip to content

webgriffe/shopware-e2e-test-demo

Repository files navigation

Shopware End-to-End Test Demo Project

This repository contains a Shopware 6 demo project with end-to-end tests.

Requirements

Installation

Install PHP dependencies:

composer install

Install end2end test suite Node.js dependencies:

(cd tests/acceptance && npm install)

Create a compose.override.yml file like the following and adapt it to fit your system:

services:
    ###> shopware/core ###
    database:
        ports:
            - "3306:3306"
    labels:
        # The following is important to avoid Symfony CLI injecting wrong DATABASE_URL for e2e env.
        com.symfony.server.service-ignore: true
    ###< shopware/core ###

    ###> symfony/mailer ###
    mailer:
        image: axllent/mailpit
        ports:
            - "1025:1025"
            - "8025:1025"
        environment:
            MP_SMTP_AUTH_ACCEPT_ANY: 1
            MP_SMTP_AUTH_ALLOW_INSECURE: 1
    ###< symfony/mailer ###

    ###> shopware/elasticsearch ###
    opensearch:
        ports:
            - "9200:9200"
    ###< shopware/elasticsearch ###

Start development services with:

composer dev:start

This command will:

  1. Start Docker Compose
  2. Start Symfony CLI proxy
  3. Start a Symfony CLI server for development on port 8000
  4. Start a Symfony CLI server for end-to-end tests on port 8005

Create an .env.local file like the following and adapt it to fit your system:

MAILER_DSN=smpt://127.0.0.1:1025
APP_ENV=dev
APP_URL=http://127.0.0.1:8000
BLUE_GREEN_DEPLOYMENT=0
DATABASE_URL=mysql://root:[email protected]/shopware
OPENSEARCH_URL=http://127.0.0.1:9200
SHOPWARE_ES_ENABLED=1
SHOPWARE_ES_INDEXING_ENABLED=1

Install Shopware on development database with:

bin/console system:install --basic-setup

Prepare for end-to-end tests

Create an .env.e2e.local file like the following and adapt it to fit your system:

DATABASE_URL=mysql://root:[email protected]:3306/shopware_e2e

The DATABASE_URL env var in this file should point to a different database to use with end-to-end tests.

Then prepare end-to-end tests database and dump with:

composer test:e2e:prepare

This command will:

  1. Install Shopware on end-to-end tests database
  2. Disable first run wizard on that database

Run end-to-end tests

When you have end-to-end database prepared you can run end-to-end tests with:

composer test:e2e

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published