我正在使用lmc-eu/steward
在php中使用Selenium服务器编写测试用例,我正在运行此测试用例直接命令,该命令运行正常,但由于我已将其添加到bitbucket管道中,因此出现了错误
浏览器:chrome 环境:测试
灯具结果的基本路径:/ ws / annotator-php / tests
日志路径:/ ws / annotator-php / logs 忽略延迟:否
硒服务器(hub)网址:http://localhost:4444,正在尝试连接...连接错误(“无法分配请求的地址”)
[错误]确保您的Selenium服务器可以在url上真正访问
进行更改
“ http://localhost:4444”或使用--server-url选项
步骤(图像:ubuntu:16.04
):
# script:
- apt-get update -y
- apt-get install openjdk-8-jre -y
- apt-get install -y python-software-properties software-properties-common curl openjdk-8-jre-headless
- LANG=C.UTF-8 add-apt-repository ppa:ondrej/php
- apt-get update -y
- # php install
- apt-get install php5.6 php5.6-zip libapache2-mod-php5.6 php5.6-cgi php5.6-cli php5.6-curl php5.6-imap php5.6-gd php5.6-mysql php5.6-pgsql php5.6-sqlite3 php5.6-mbstring php5.6-json php5.6-bz2 php5.6-mcrypt php5.6-xmlrpc php5.6-gmp php5.6-xsl php5.6-soap php5.6-xml php5.6-zip php5.6-dba php5.6-bcmath -y
- curl -sS https://getcomposer.org/installer -o composer-setup.php && php composer-setup.php --install-dir=/usr/local/bin --filename=composer
- #Chrome Install
- curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb
- dpkg -i /chrome.deb || apt-get install -yf
- rm /chrome.deb
# install chromedriver
- apt-get install -yqq unzip
- wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
- unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
# set display port to avoid crash
- export DISPLAY=:99
- SDK_VERSION=230.0.0
- SDK_FILENAME=google-cloud-sdk-${SDK_VERSION}-linux-x86_64.tar.gz
- curl -O -J https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${SDK_FILENAME}
- tar -zxvf ${SDK_FILENAME} --directory ${HOME}
- export PATH=${PATH}:${HOME}/google-cloud-sdk/bin
- ${HOME}/google-cloud-sdk/bin/gcloud --version
- ${HOME}/google-cloud-sdk/bin/gcloud components list
- ${HOME}/google-cloud-sdk/bin/gcloud components install app-engine-php --quiet
- cd annotator-php
- apt-get update -y
- ${HOME}/google-cloud-sdk/bin/dev_appserver.py app.yaml --php_executable_path /usr/bin/php-cgi &
- Xvfb :0 -ac -screen 0 1024x768x24 &
- java -Dwebdriver.chrome.driver=/tmp/chromedriver -jar tests/selenium-server-standalone-3.141.59.jar -port 4444 &
- ./vendor/bin/steward run test chrome -vvv