首页 > 解决方案 > 如何在 docker 环境中运行 selenium 测试 jar 后生成诱惑报告

问题描述

在 docker 容器中运行 selenium 可执行 jar 后,我正在尝试执行诱惑报告。我一直试图让它工作 4 天,有人可以建议我是否遗漏了什么或使用了错误的方法?

到目前为止我所做的和尝试的:

下面是我的 dockerfile 的示例

RUN wget https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip 
RUN mv chromedriver /usr/bin/chromedriver 
RUN chown root:root /usr/bin/chromedriver 
RUN chmod +x /usr/bin/chromedriver

RUN wget https://github.com/allure-framework/allure-core/releases/download/allure-core-1.4.24.RC2/allure-commandline.zip && \
     unzip allure-commandline.zip && bin/allure && rm allure-commandline.zip

FROM gradle:6.1.1-jdk8 AS sdk
WORKDIR /auto

WORKDIR /auto/build 
RUN gradle clean fatJar -x test

FROM runtime AS final 
COPY --from=sdk path/to/jar/automation-stuff*.jar ./auto-testing.jar 

ENTRYPOINT ["java", "-jar", "auto-testing.jar"]

这些都没有产生任何结果,所以如果有人可以帮助我,我会非常感激。所以只是为了澄清这只是生成魅力报告的一个问题。

标签: dockerseleniumjunit4allure

解决方案


您可以使用 Allure Docker 服务容器。一旦您的测试生成了诱惑结果,您就可以使用 Allure API 发送它们并查看您的更新报告。 https://github.com/fescobar/allure-docker-service#send-results-through-api


推荐阅读