J'utilise playwright avec squasht TM et orchestrator comme suis :
Code : Tout sélectionner
name: squash
services:
squash-tm-pg:
container_name: squash-tm-pg
hostname: squash-tm-pg
image: postgres:${POSTGRES_VERSION}
restart: always
ports:
- "${DB_PORT}:5432"
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- ./volumes/database:/var/lib/postgresql
squash-tm:
privileged: true
container_name: squash-tm
hostname: squash-tm
image: squashtest/squash:latest
restart: always
ports:
- "${PORT_SQTM}:8080/tcp"
environment:
SQTM_DB_HOST: squash-tm-pg
SQTM_DB_TYPE: ${DB_SQTM_TYPE}
SQTM_DB_NAME: ${DB_DATABASE}
SQTM_DB_USERNAME: ${DB_USER}
SQTM_DB_PASSWORD: ${DB_PASSWORD}
VIRTUAL_HOST: ${HOST_INTERNAL}
volumes:
- ./volumes/conf/squash.tm.cfg.properties:/opt/squash-tm/conf/squash.tm.cfg.properties
- ./volumes/recette:/opt/squash-tm/recette
- ./volumes/logs:/opt/squash-tm/logs
- ./volumes/plugins:/opt/squash-tm/plugins
depends_on:
- squash-tm-pg
orchestrator:
privileged: true
container_name: orchestrator
hostname: orchestrator
image: squashtest/squash-orchestrator:latest
restart: always
ports:
- "7774:7774" #receptionnist
- "7775:7775" #observer
- "7776:7776" #killswitch
- "38368:38368" #eventbus
- "34537:34537" #localstore
- "24368:24368" #agentchannel
- "12312:12312" #quality gate
environment:
- SSH_CHANNEL_HOST=${HOST}
- SSH_CHANNEL_USER=${SSH_USER}
- SSH_CHANNEL_PASSWORD=${SSH_PWD}
- SSH_CHANNEL_TAGS=${TAGS}
- JWT_SECRET=${JWT_SECRET}
# - DEBUG_LEVEL=DEBUG
volumes:
- ./volumes/trusted_keys/trusted_key.pub:/etc/squashtf/trusted_key.pub:ro
- ./volumes/orchestrator:/tmp/
agent-playwright:
privileged: true
container_name: agent-playwright
hostname: agent-playwright
restart: always
build:
context: ./playwright
dockerfile: Dockerfile
environment:
- HOST=${HOST_INTERNAL}
- TOKEN=${TOKEN}
- TAGS=${TAGS_PLAYWRIGHT}
depends_on:
- orchestrator
scheduler:
container_name: scheduler
hostname: scheduler
restart: always
build:
context: ./scheduler
dockerfile: Dockerfile
environment:
- SQUASH_API_URL=http://${HOST}:${PORT_SQTM}/squash/${SQUASH_API_BASE_PATH}
ports:
- "${PORT_SCHEDULER}:8000"
depends_on:
- orchestrator
Ma config "playwright.config.js"
Code : Tout sélectionner
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [
['junit', { outputFile: 'results/results.xml' }],
['html', { outputFolder: 'results/html-report', open: 'never' }],
],
use: {
screenshot: 'only-on-failure',
trace: 'on-first-retry', // utile pour debugger
video: 'retain-on-failure',
testIdAttribute: 'data-testid',
},
outputDir: 'results/artifacts',
projects: [
{
name: 'chrome',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
],
});
Cordialement
Alexandre