java - 当我在 Jenkins 中运行构建时,我得到了这个错误:在 PATH 中找不到 firefox 二进制文件。确保已安装 Firefox
问题描述
我在 Jenkins 中创建了一个作业 Maven 项目,目的是编译和执行我所有的自动测试,但是当我构建作业时,我得到了这个错误:
对于所有场景,我都收到相同的消息错误
我应该创建一个管道来代替项目 maven 吗?
我使用链接 ssh GitLab 恢复我的项目,并且我在代理后面工作
Thnaks(y)
解决方案
这是一个docker-compose
文件,它将在 chrome 上打开 7 个 FF 实例和 1 个实例。我将它与 azure 管道一起使用,但您可以将它与 jenkins 集成。您将不得不添加一个运行的詹金斯任务docker-compose
要在命令行上尝试,只需安装 docker 桌面(我将它与 mac 一起使用)并运行以下命令
docker-compose -f /path/of/file up
version: "3"
services:
selenium-hub:
image: selenium/hub:3.141.59-20210607
container_name: selenium-hub
ports:
- "65299:4444"
chrome:
image: selenium/node-chrome:3.141.59-20210607
depends_on:
- selenium-hub
environment:
- HUB_HOST=selenium-hub
- HUB_PORT=4444
firefox:
image: selenium/node-firefox:3.141.59-20210607
depends_on:
- selenium-hub
environment:
- HUB_HOST=selenium-hub
- HUB_PORT=4444
deploy:
mode: replicated
replicas: 7
对于docker-compose
与 azure pipeline 一起使用,我正在使用以下内容。确保您已dockerRegistryEndpoint
设置(在下面的示例中:Dockerhub)。我用它来运行我的黄瓜测试并将第三方黄瓜报告(PublishCucumberReport@1
)集成到管道中
trigger:
- master
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build and Push image
jobs:
- job: Build
displayName: Build and Push
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DockerCompose@0
displayName: open browser instances
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: Dockerhub
dockerComposeFile: '**/docker-compose.yml'
action: 'Run a Docker Compose command'
dockerComposeCommand: 'up -d'
detached: true
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/target/cucumber.html'
goals: 'clean verify -P acceptanceTests -e -X'
- task: PublishPipelineArtifact@1
displayName: Publish cucumber report
inputs:
pathToPublish: $(System.DefaultWorkingDirectory)/s/target/cucumber-report/
artifactName: 'cucumber.html'
- task: PublishCucumberReport@1
inputs:
jsonDir: ./target/cucumber-report/
outputPath: ./target/
有关文档,请参阅 - https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/docker-compose?view=azure-devops
推荐阅读
- verilog - 时钟两端的计数器变化
- swift - 单击查看 SwiftUI 时如何关闭菜单
- javascript - 从网络 json 文件显示 SectionList
- python - 如何将不同形状的多个数据框的计算过程导出到 Excel 中的一张表?
- angular - 图表中数据集数据的最大长度
- javascript - 如何将 js 滑动箭头转换为 html 标记
- c++ - 标准::cin >> c; 将数字读入数组后被忽略
- kubernetes - 如何查看附加到 pod 中容器的卷并将一些数据写入其中
- node.js - 如何/从哪里获取 Cybersource 商务中心的 MerchantKeyId 和 MerchantSecretKey?
- javascript - 将 DOM 元素创建到集合的项目中