Bamboo配置计划脚本

 

选择  ->  configure branch

 

 

 

报告生成脚本配置地址

 

编辑对应的脚本

#!/bin/bash
set -xe
# # The following could go into a dockerfile in the repo
# # FROM node:14.17.1
# export DEBIAN_FRONTEND=noninteractive
# apt-get update
# apt-get install -y software-properties-common openjdk-8-jre-headless libappindicator1 fonts-liberation
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# # sudo apt-get update && sudo apt-get install -f
# # apt install ./google-chrome-stable_current_amd64.deb
# apt install -y --fix-broken ${PWD}/*.deb
# # End dockerfile

export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -y
apt-get install -y software-properties-common openjdk-11-jre-headless libappindicator1 fonts-liberation
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
apt-get update && apt-get install -y google-chrome-stable

# npm cache verify
npm cache clean --force
npm install -f
npx selenium-standalone install
npm install qs
export HEADLESS=true
export ENVIRONMENT=${bamboo.environment}
export BROWSERSTACK_USERNAME=${bamboo.BROWSERSTACK_USERNAME}
export BROWSERSTACK_ACCESS_KEY=${bamboo.BROWSERSTACK_ACCESS_KEY}

export TESTRAIL_REST_URL='https://promethean.testrail.net'
export TESTRAIL_USERNAME=${bamboo_TESTRAIL_USERNAME}
export TESTRAIL_PASSWORD_KEY=${bamboo_TESTRAIL_PASSWORD_KEY}
export TESTRAIL_RUN_ID=${bamboo.testrail_run_id}

# npm run test -- ${bamboo.custom} --headless --platform web --maxInstances 3

npm run test -- ${bamboo.custom} --platform web --maxInstances 5

# Show files to see where tests are output so we can have bamboo pick it up in a later step
ls -lahR

 

 

修改脚本npm run test的方式为无头模式

 

#!/bin/bash
set -xe
# # The following could go into a dockerfile in the repo
# # FROM node:14.17.1
# export DEBIAN_FRONTEND=noninteractive
# apt-get update
# apt-get install -y software-properties-common openjdk-8-jre-headless libappindicator1 fonts-liberation
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# # sudo apt-get update && sudo apt-get install -f
# # apt install ./google-chrome-stable_current_amd64.deb
# apt install -y --fix-broken ${PWD}/*.deb
# # End dockerfile

export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -y
apt-get install -y software-properties-common openjdk-11-jre-headless libappindicator1 fonts-liberation
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
apt-get update && apt-get install -y google-chrome-stable

# npm cache verify
npm cache clean --force
npm install -f
npx selenium-standalone install
npm install qs
export HEADLESS=true
export ENVIRONMENT=${bamboo.environment}
export BROWSERSTACK_USERNAME=${bamboo.BROWSERSTACK_USERNAME}
export BROWSERSTACK_ACCESS_KEY=${bamboo.BROWSERSTACK_ACCESS_KEY}

export TESTRAIL_REST_URL='https://promethean.testrail.net'
export TESTRAIL_USERNAME=${bamboo_TESTRAIL_USERNAME}
export TESTRAIL_PASSWORD_KEY=${bamboo_TESTRAIL_PASSWORD_KEY}
export TESTRAIL_RUN_ID=${bamboo.testrail_run_id}

npm run test -- ${bamboo.custom} --headless --platform web --maxInstances 3

# npm run test -- ${bamboo.custom} --platform web --maxInstances 5

# Show files to see where tests are output so we can have bamboo pick it up in a later step
ls -lahR

 

 

出现问题一:

2023-05-05T06:04:30.620Z ERROR webdriver: session not created: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited abnormally.

 

原因:

 

 

就是  他的配置  service 这边 是browserstack的server服务 所以wdio.conf这个脚本 他会同时去兼容firefox safari的driver

但是我们使用的脚本只有去下载chromedriver

 

出现问题二:

 

 把global的panel赋值 给 换成null 避免panel的全局调用找不到 panel的问题

 

posted @ 2022-12-06 10:38  陈晓猛  阅读(208)  评论(0编辑  收藏  举报