无法从詹金斯泊坞窗运行appium测试

时间:2018-12-05 11:26:39

标签: docker jenkins appium selenium-grid2

  1. 我在2个文件夹中有2张图片,如下所示: [结构] [1]
  2. appium docker-compose.yml文件的内容:

    # Note: It requires docker-compose 1.6.0+
    #
    # Usage: docker-compose up -d
    version: '3'
    
    services:
      # Selenium hub
      selenium_hub:
        image: selenium/hub
        ports:
          - 4444:4444
        environment:
          GRID_TIMEOUT: 120
    
      # Appium Docker Android  
      appium_android_device:
        image: appium/appium
        depends_on:
          - selenium_hub
        privileged: true
        volumes:
          - /dev/bus/usb:/dev/bus/usb
          - ~/.android:/root/.android
        environment:
          - CONNECT_TO_GRID=true
          - SELENIUM_HOST=selenium_hub
          # Enable it for msite testing
          #- BROWSER_NAME=chrome
    

3。jenkins docker-compose.yml文件的内容:

# Usage: docker-compose up
version: '3'

services:

  jenkins:
    build: .
    container_name: jenkins
    privileged: true
    restart: always
    ports:
      - 8080:8080   
    volumes:
      - ./jenkins_home:/var/jenkins_home

4。jenkins Dockerfile文件的内容:

FROM jenkins/jenkins:lts

USER root

#We used `JAVA_OPTS` to disable the setup wizard. We won’t need it since our setup will be fully automated.
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"

RUN apt-get update && apt-get install -y maven

#Create admin account
COPY security.groovy /usr/share/jenkins/ref/init.groovy.d/security.groovy

#automatically installing all plugins
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

================================================ ============================= 问题是: -我从硒网格泊坞窗开始appium -我开始詹金斯码头工人 -我打开浏览器并登录到jenkins服务器以创建作业来测试我的appium脚本。我的网格URL是 http://localhost:4444/wd/hub ,但测试失败。它显示错误:

org.openqa.selenium.WebDriverException: 
Connection refused (Connection refused)
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: '7e13f85b5d8f', ip: '172.22.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-39-generic', java.version: '1.8.0_181'
Driver info: driver.version: AndroidDriver
Caused by: java.net.ConnectException: Connection refused (Connection refused)

-我试图在主机上安装jenkins(不使用docker)并连接到同一个appium docker来运行我的脚本,该脚本成功运行。 我是否需要在我的詹金斯码头工人上做其他事情,所以我在詹金斯码头工人到鸦片码头工人的工作还可以吗?

请帮助。谢谢。

0 个答案:

没有答案