Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: E2E Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
e2e:
name: E2E Tests (${{ matrix.neos }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
neos: [neos8, neos9]

steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version-file: Tests/E2E/.nvmrc
cache: npm
cache-dependency-path: Tests/E2E/package-lock.json

- name: Install dependencies
working-directory: Tests/E2E
run: npm ci

- name: Install Playwright browsers
working-directory: Tests/E2E
run: npx playwright install --with-deps chromium

- name: Pre-build Docker image
run: docker compose -f Tests/E2E/system_under_test/${{ matrix.neos }}/docker-compose.yaml build --pull

- name: Run Tests
working-directory: Tests/E2E
run: npm run test:${{ matrix.neos }}

- name: Upload Playwright report
uses: actions/upload-artifact@v7
if: ${{ always() }}
with:
name: playwright-report-${{ matrix.neos }}
path: Tests/E2E/playwright-report/
retention-days: 7
7 changes: 7 additions & 0 deletions Tests/E2E/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 3rd party sources
node_modules/

# transient test files
.features-gen/
test-results/
playwright-report/
1 change: 1 addition & 0 deletions Tests/E2E/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
min-release-age = 7 # days
1 change: 1 addition & 0 deletions Tests/E2E/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.14.1
1 change: 1 addition & 0 deletions Tests/E2E/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# using prettier defaults
100 changes: 100 additions & 0 deletions Tests/E2E/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
NEOS8_COMPOSE = $(CURDIR)/system_under_test/neos8/docker-compose.yaml
NEOS9_COMPOSE = $(CURDIR)/system_under_test/neos9/docker-compose.yaml

.SILENT:
.PHONY: help \
setup setup-sut setup-test \
generate-bdd-files \
test test-neos8 test-neos9 \
start-sut-neos8 start-sut-neos9 \
log-sut-neos8 log-sut-neos9 \
enter-sut-neos8 enter-sut-neos9 \
sut-down

# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
RESET := $(shell tput -Txterm sgr0)

# running `make` without a target shows the help
.DEFAULT_GOAL := help

## Show this help
help:
echo ""
echo "Usage: $(YELLOW)make <target>$(RESET)"
awk -v green="$(GREEN)" -v yellow="$(YELLOW)" -v reset="$(RESET)" ' \
/^##@ / { printf "\n%s%s%s\n", green, substr($$0, 5), reset; next } \
/^## / { doc = substr($$0, 4); next } \
/^[a-zA-Z0-9_-]+:/ { if (doc != "") { sub(":$$", "", $$1); printf " %s%-20s%s %s\n", yellow, $$1, reset, doc; doc = "" } } \
' $(MAKEFILE_LIST)
echo ""

##@ Setup

## Build SUT images and install the test setup
setup: setup-sut setup-test

## Build the SUT docker images
setup-sut:
docker compose -f $(NEOS8_COMPOSE) build --pull
docker compose -f $(NEOS9_COMPOSE) build --pull

## Install nodejs, npm dependencies and playwright browsers
setup-test:
echo "${GREEN}Installing test setup.${RESET}"
if [ -s "$$NVM_DIR" ]; then \
. "$$NVM_DIR/nvm.sh" && echo "${GREEN}Found nvm on system -> using it to install nodejs!${RESET}" && nvm install; \
fi && \
npm install && npx playwright install --with-deps chromium && \
echo "" && echo "${GREEN}generate BDD files from feature files${RESET}" && npm run generate-tests

##@ Tests

## Generate BDD files from feature files
generate-bdd-files:
echo "${GREEN}generate BDD files from feature files${RESET}"
npm run generate-tests

## Run all E2E tests
test: test-neos8 test-neos9

## Run all Neos 8 E2E tests
test-neos8:
npm run test:neos8

## Run all neos9 E2E tests
test-neos9:
npm run test:neos9

##@ System under test (SUT)

## Start the Neos 8 SUT containers
start-sut-neos8:
docker compose -f $(NEOS8_COMPOSE) up -d --build

## Start the Neos 9 SUT containers
start-sut-neos9:
docker compose -f $(NEOS9_COMPOSE) up -d --build

## Show Neos 8 SUT container logs
log-sut-neos8:
docker compose -f $(NEOS8_COMPOSE) logs -f

## Show Neos 9 SUT container logs
log-sut-neos9:
docker compose -f $(NEOS9_COMPOSE) logs -f

## Enter Neos 8 SUT
enter-sut-neos8:
docker compose -f $(NEOS8_COMPOSE) exec neos bash

## Enter Neos 9 SUT
enter-sut-neos9:
docker compose -f $(NEOS9_COMPOSE) exec neos bash

## Tear down all docker compose environments and remove volumes
sut-down:
echo "${YELLOW}Shutting down all SUTs and removing their volumes.${RESET}"
docker compose -f $(NEOS8_COMPOSE) down -v
docker compose -f $(NEOS9_COMPOSE) down -v
Loading