-
Notifications
You must be signed in to change notification settings - Fork 24
1 Installation
There are several options for TESTAR installation:
- Using Docker containers with TESTAR (currently only for web apps)
- Installing Java binaries of the latest TESTAR release
- Using a virtual machine with TESTAR and other required software
- Building TESTAR from the Java source code
- Hosted server with a virtual machine with TESTAR and other required software (limited availability)
We need to install Docker on Windows + Windows Subsystem for Linux (WSL)
- https://docs.docker.com/docker-for-windows/install/
- https://docs.microsoft.com/es-es/windows/wsl/install-win10#step-4
If Docker is installed correctly, you will be able to execute docker --version
and wsl -l -v
commands to verify the version of these tools.
Furthermore, if we open the Docker Desktop
application we can verify in the lower left corner that Docker is running correctly.
Use a Windows (CR + LF) end of line, it can affect the correct TESTAR_dev\runImage
script execution.
To avoid issues you can execute next git command before clone the docker proyect:
git config --global core.autocrlf input
Now we can clone current docker repository:
git clone https://github.com/TESTARtool/TESTAR_dev.git -b arend_kubernetes --single-branch
Docker container needs a directory reference to our Windows host, we can do this using the --mount
options.
This will allow us to modify and customize settings protocols and to store output results from outside the Docker container.
To do this we need to adapt our Windows host directories, or edit in the TESTAR_dev\makeAndRunDocker.bat
file the docker run --mount
references:
-
Create the directories
C:\testardock\settings
andC:\testardock\output
in our Windows enviroment. -
Modify the default reference
C:\Users\a.slomp\Source\Repos\TESTAR_dev
to ourTESTAR_dev
directory: ExampleC:\Users\testar\Desktop\TESTAR_dev
-
Rename docker tag name
aslomp/testar:latest
if desired (also references)
Inside the settings mounted directory we need to include the desired webdriver java protocol with their settings. Also is important to mention that we need to create a webdriver_xxxxxx.sse
file to indicate to TESTAR that we want to use that specific protocol when it runs.
In the test.settings
file there are some important settings that we need to customize:
-
Mode = Generate
Inside Docker we only want to execute TESTAR in generate mode -
SUTConnectorValue = "/usr/bin/chromedriver"
This is the internal Docker image directory where we can find the chromedriver tool -
ShowVisualSettingsDialogOnStartup = false
Disable the TESTAR GUI, because will be displayed inside the container and no one will be able to interact with -
ShowSettingsAfterTest = false
+VisualizeSelectedAction = false
+FlashFeedback = false
Disable more GUI options -
ProtocolCompileDirectory = /tmp
Should be set to an internal directory of the Docker image e.g. /tmp (this is where the compiled java files are written to)
To build the Docker container we use the TESTAR_dev\makeAndRunDocker.bat
file, we can open command line or powershell console and execute it.
This gradle task will compile TESTAR and create a testar.tar distribution
call gradlew distTar
This is the Docker build instruction that will invoke the TESTAR_dev\Dockerfile
file to build an image with the specific tag name aslomp/testar:latest
docker build -t aslomp/testar:latest .
Finally, after the Dockerfile
execution, we will run a Docker container using the mounted directories
docker run -d --shm-size=512M --mount type=bind,source="c:\testardock\output",target=/testar/bin/output --mount type=bind,source="C:\testardock\settings",target=/testar/bin/settings --mount type=bind,source="C:\Users\testar\Desktop\TESTAR_dev",target=/mnt aslomp/testar:latest
Download the chrome docker image we need to execute TESTAT with chromedriver
FROM selenium/standalone-chrome
Become superuser to have permissions
USER root
Update the docker environment and install openjdk-14 TESTAR requirement and install required x11 library to interact with the X-GUI
RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update && apt-get install -y openjdk-14-jdk libxkbcommon-x11-0
Add previous .tar distribution to this docker container
ADD testar/target/distributions/testar.tar .
Set the Java Home directory in our docker container environment
ENV JAVA_HOME "/usr/lib/jvm/java-14-openjdk-amd64"
Set the display in our docker container environment, to know how to communicate with the GUI
ENV DISPLAY=":99.0"
Copy the "TESTAR_dev\runImage" script inside the docker container, because is the one we use to launch TESTAR
COPY runImage /runImage
Copy "TESTAR_dev\README.Docker" informative instructions
COPY README.Docker /README.Docker
Add executable permissions to the runImage script
RUN chmod 777 /runImage
Add a command line instruction to execute runImage script. This will execute this script if the docker container it is executed without specific commands
CMD [ "sh", "/runImage"]
Previous Dockerfile will create the docker container and TESTAR_dev\runImage
will execute TESTAR software inside the docker container.
Declare we want to use default /bin/sh unix shell
#!/bin/sh
Print informative instructions in the console
cat /README.Docker
Start the virtual X-server enviroment, that allows TESTAR to execute GUI interaction
echo "Start Xvfb" /opt/bin/start-xvfb.sh & sleep 2
Move to TESTAR directory and execute it
cd /testar/bin ./testar
https://github.com/TESTARtool/TESTAR_dev/wiki/TESTAR-Docker-issues