Skip to main content
Version: 9.0.0

Docker integration

Test Maker runs in all CI environment the same. Test Maker can integrate with Docker.

USER root

RUN apt-get upgrade && apt-get update && apt-get install -y curl nano vim openssh-server ssh sudo git

Example with Github ssh keys

This example represents hardcoded shh keys settings but could be parametrized too:

COPY id_ed25519 /root/.ssh/id_ed25519
RUN ssh-keyscan github.com > /root/.ssh/known_hosts

Installation (Docker image)

The example below represents the installation of a cloned project that includes Test Maker as a zip file. Test Maker has to be installed first. We invite you to consult how part dealing with Test Maker installation.

Executed inside docker container:

Make sure to replace the <> fields with the actual project name and repository.

RUN curl -fsSL http://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs vim ant
RUN npm i playwright -g
RUN npx playwright install-deps
WORKDIR /root
ARG CACHE_DATE=2016-01-01
RUN mkdir /root/<PROJECT NAME>
RUN rm -rf /root/<PROJECT NAME>
RUN git clone --single-branch --branch $BRANCH <PROJECT REPOSITORY>
WORKDIR /root/<PROJECT NAME>
#RUN npm init -y
ARG CACHE_DATE=2016-01-01
RUN rm -rf node_modules
ARG CACHE_DATE=2016-01-01
RUN rm -rf package-lock.json
RUN npm i
ENTRYPOINT [""]

To build the image

docker build --build-arg BRANCH=<branch name> --no-cache --progress=plain --tag="<project name>:<tag>"

To execute:

docker run -i -v <path to the folder where you want to see your reports and logs>:/root/<project name>/dist <image>:<tag> npm run test:ci
caution

SSH keys are required to download the project. Public and private keys should be available in the root folder (or specify other path in the Dockerfile) #Permission to read Dockerfile and keys should be granted

Complete docker file

FROM ubuntu:20.04
MAINTAINER Administrator <docker@k-expert.com>
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Paris"
ARG BRANCH=master
RUN echo "GIT Branch used is:" && echo $BRANCH
USER root
RUN apt-get upgrade && apt-get update && apt-get install -y curl nano vim openssh-server ssh sudo git
COPY id_ed25519 /root/.ssh/id_ed25519

#example for Github ssh keys
RUN ssh-keyscan github.com > /root/.ssh/known_hosts

RUN curl -fsSL http://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs vim ant
RUN npm i playwright -g
RUN npx playwright install-deps
WORKDIR /root
ARG CACHE_DATE=2016-01-01
RUN mkdir /root/<PROJECT NAME>
RUN rm -rf /root/<PROJECT NAME>
RUN git clone --single-branch --branch $BRANCH <PROJECT REPOSITORY>
WORKDIR /root/<PROJECT NAME>
#RUN npm init -y
ARG CACHE_DATE=2016-01-01
RUN rm -rf node_modules
ARG CACHE_DATE=2016-01-01
RUN rm -rf package-lock.json
RUN npm i
ENTRYPOINT [""]

##########
#Important! ssh keys are required to download the project. Public and private keys should be available in the root folder (or specify other path in the Dockerfile)
#Permission to read Dockerfile and keys should be granted

##########
#To build the image:
#docker build --build-arg BRANCH=<branch name> --no-cache --progress=plain --tag="<project name>:<tag>"

##########
#To execute:
#docker run -i -v <path to the folder where you want to see your reports and logs>:/root/<project name>/dist <image>:<tag> npm run test:ci


System requirements

ANSI support for login

NodeJS

Git (if using source control)

Here is a list of the dependencies that will be installed with Playwright. Specific dependencies.

Default Test Maker configuration

By default, Test Maker comes with a ci configuration.

test-maker.ci.ts

import { Configuration, reporters } from "test-maker";

const testMakerCIConfig: Configuration = {
runner: {
liveMode: false,
headless: true,
timeout:{
selector:10000,
assertion:12000
}
},
reporting: {
reporters: [reporters.terminal, reporters.allure],
screenshots: {
enabled: true
}
},
};
export default testMakerCIConfig;

It's also recommended to add the following options to the configuration file:

const testMakerCIConfig: Configuration = {

debugging:{
enabled:false,
},
}

In order to deactivate debugging mode as to avoid having hanging execution in debugging mode inside your pipeline.

GUI requirements (headless mode )

By default, when running Test Maker with docker, no Graphical User Interface (GUI) is present. That's why the test execution will be done in headless mode. The Test Maker configuration will then have the headless option enabled and set as true.

const testMakerCIConfig: Configuration = {
runner: {
headless: true,
},

};
export default testMakerCIConfig;

Parameters usage

You can use parameters to handle different part of the configuration from the platform directly. For example, you can parametrize the number of parallel threads or the test suites that you'd like to execute.

Source control

For source code management, if you are intent on pulling your test project from a version control platform, you will need to provide at least credentials to access the repository and url of the repository.

Reporting

All Test Maker reporters are available on any CI system. For some of them you need to have extra configuration of your CI system.

Logs

Test Maker terminal reporter is your logging utility in your CI system. You can then have logs about Test Maker process ,errors,etc...