У меня есть настройка в jenkins, которая использует образ докера узла в агенте, устанавливает chrome и testcafe в jenkinsfile, что проверяется запуском testcafe -b в jenkinsfile и просмотром chrome в качестве доступного браузера. Однако каждый раз, когда я использую тест npm точно так же, как на своей локальной машине, я получаю ....
Error: Unable to establish one
or more of the specified browser connections. This can be caused by
network issues or remote device failure.
Я не уверен, где я ошибаюсь, я не знаю, актуально ли то, что я настроил свой собственный тестовый бегун в соответствии с документированными инструкциями, поэтому я не использую контейнер docker testcafe. вот мой файл jenkins ...
pipeline {
agent {
docker { image 'node:8.11-jessie' }
}
stages {
stage('Node check'){
steps {
sh 'node -v'
}
}
stage('Install Chrome') {
steps {
sh 'apt-get update'
sh 'apt-get install -y gconf-service libasound2 libappindicator3-1 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget'
sh 'rm -rf /var/lib/apt/lists/*'
sh 'wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb'
sh 'dpkg -i google-chrome*.deb'
}
}
stage('Npm installs') {
steps {
sh 'npm install -g testcafe testcafe-reporter-xunit'
sh 'npm install'
}
}
stage('browsers') {
steps {
sh 'testcafe -b'
}
}
stage('Test test'){
steps{
sh 'npm test -- --env=gamma --browsers=chrome:headless'
}
}
}
post {
always {
junit '**/testcafe/res.xml'
}
}
}