To connect to DB, I had to move to docker setup. Now all my webdriverio tests executes in docker container with Saucelabs.
My tests executes based on some environment variables: portal type, environment, device, browser, etc.
I would like to create different docker-compose files for desktop, tab and mobile which will help me to run as per the req.
File for tablet execution: (Like below, I have 2 more for desktop and mobile)
version: '3.3'
services:
wdio:
image: wdio-tab-image
container_name: wdio-tab
build: .
environment:
- PORTAL=${PORTAL}
- ENV=${ENV}
- BATCH_NAME="${PORTAL} - Regression Test Tab"
- PLATFORM=Tab
- EYES=${EYES}
- SUITE=regression::tab
- DEVICE=${DEVICE}
volumes:
- .:/opt/node/portal/
- /opt/node/portal/node_modules
ports:
- '6060:6060'
#restart: always
Dockerfile:
FROM node:12
RUN apt-get update && apt-get install -y
apt-utils
ssh
ksh
zip
git
unzip
unixodbc
unixodbc-dev
zlib1g-dev
libzip-dev
curl
# Change the working directory
WORKDIR /opt/code/app
# Install app dependencies
COPY package.json ./
RUN npm install
# Copy code to working directory
COPY . .
# Execute tests
ENTRYPOINT ["sh", "-c", "npm run $SUITE" ]
Command using to execute: docker-compose -f docker-compose.tab.yml up --build
When I run tab compose file with different portal env at a time, first one stops execution and second is throwing some test error.
I nee help in how to arrange the compose files as per below requirements:
- My framework is mono repo which contains automation for 5 portals
- I would like to setup docker files in a way that it differentiates the files based on platform - desktop, tab and mobile. These files should be capable to run even in parallel in all portals.
Any help would be appreciated.
question from:
https://stackoverflow.com/questions/65652007/how-to-arrange-docker-compose-files-based-on-the-test-suite-website-environmen 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…