Skip to content
Merged
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
12 changes: 12 additions & 0 deletions e2e-playwright/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM mcr.microsoft.com/playwright:v1.52.0-jammy

WORKDIR /app

COPY package*.json ./
RUN npm install

COPY . .

RUN npx playwright install

CMD ["npm", "test"]
56 changes: 56 additions & 0 deletions e2e-playwright/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 🧪 kafbat-e2e-playwright
End-to-End UI test automation using **Playwright**, **Cucumber.js**, and **TypeScript**.
---

## Prerequisites

- **Node.js** >= 18
- **npm** or **yarn**
- Install dependencies and Playwright browsers:

```bash
Local run:
Run kafbat (docker compose -f ./documentation/compose/e2e-tests.yaml up -d)
npm install
npx playwright install

🔹 Normal Test Run
npm test:stage

🔹 Debug Mode (with Playwright Inspector)
npm run debug

🔹 Rerun Failed Tests
npm run test:failed


Gihub action CI example
name: CI

on:
push:
branches: [ main ]
pull_request:

jobs:
container-test-job:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install NPM dependencies
run: npm install

- name: Install Playwright browsers
run: npx playwright install

- name: 🚀 Run tests with ENV=prod
run: cross-env ENV=prod HEAD=false BASEURL=http://localhost:8080 npm run test

51 changes: 51 additions & 0 deletions e2e-playwright/config/cucumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = {
default: {
timeout: 30000,
tags: process.env.npm_config_TAGS || "",
formatOptions: {
snippetInterface: "async-await"
},
paths: [
"src/features/"
],
publishQuiet: true,
dryRun: false,
require: [
"src/steps/*.ts",
"src/hooks/hooks.ts",
"src/support/customWorld.ts"
],
requireModule: [
"ts-node/register"
],
format: [
"progress-bar",
"html:test-results/cucumber-report.html",
"json:test-results/cucumber-report.json",
"rerun:@rerun.txt"
],
parallel: 1
},
rerun: {
formatOptions: {
snippetInterface: "async-await"
},
publishQuiet: true,
dryRun: false,
require: [
"src/steps/*.ts",
"src/hooks/hooks.ts",
"src/support/customWorld.ts"
],
requireModule: [
"ts-node/register"
],
format: [
"progress-bar",
"html:test-results/cucumber-report.html",
"json:test-results/cucumber-report.json",
"rerun:@rerun.txt"
],
parallel: 1
}
}
Loading
Loading