Screenshot in Gauge Report shows only black image, please help #2722
Closed
antondebeer
started this conversation in
General
Replies: 1 comment 1 reply
-
You'll need to implement a custom screenshot handler for this |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am running Gauge from Jenkins inside a docker. Whenever I have a failed test the screenshot shows only a black image not the screengrab, see screenshot.
Here is some files that might help:
My Dockerfile:
FROM ubuntu:20.04
Ensure system is up to date before installing packages
RUN apt-get update && apt-get upgrade -y && apt-get install -y --fix-missing
curl
zip
openjdk-17-jdk
apt-transport-https
gnupg2
ca-certificates
wget
unzip
xvfb
libxi6
libgconf-2-4 &&
apt-get clean && rm -rf /var/lib/apt/lists/*
Install Google Chrome
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - &&
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list &&
apt-get update && apt-get install -y google-chrome-stable &&
google-chrome-stable --version
Download the correct ChromeDriver version and clean up
RUN wget https://storage.googleapis.com/chrome-for-testing-public/134.0.6998.35/linux64/chromedriver-linux64.zip &&
unzip chromedriver-linux64.zip &&
mv chromedriver-linux64/chromedriver /usr/local/bin/ &&
rm -rf chromedriver-linux64.zip
Install Gauge
RUN curl -SsL https://downloads.gauge.org/stable | sh
Install Gauge plugins
RUN gauge install java
&& gauge install screenshot
&& gauge install html-report
&& gauge install xml-report
&& gauge install json-report
&& gauge install flash
Set ChromeDriver path in the environment
ENV PATH="/usr/local/bin/chromedriver:$PATH"
ENV PATH=$HOME/.gauge:$PATH
Set Java Home for Java tools like Gauge
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
Set the working directory in the container
WORKDIR /workspace
Copy the gradlew and gradlew.bat files into the /workspace directory
COPY gradlew /workspace/gradlew
COPY gradlew.bat /workspace/gradlew.bat
Set executable permissions for gradlew
RUN chmod +x /workspace/gradlew
Copy the entire project into the container
COPY . /workspace/
Log versions for Chrome and ChromeDriver
RUN google-chrome-stable --version
RUN chromedriver --version
Set the default command
CMD ["bash"]
And my Jenkins Pipeline:
pipeline {
agent any
}

Beta Was this translation helpful? Give feedback.
All reactions