BDD Tests are failing due to Chrome session not being able to create on CI pipeline
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- docker, github-actions, javascript, node.js
- Domínio
- ci-cd, testing-qa
Direção de pesquisa
Comece com workflow.yml e as configurações do WebDriver em test.codecept.conf.js; execute o comando npx codeceptjs mostrado e inspecione os logs de inicialização do serviço hub/chrome e de criação de sessão. Está concluído quando a execução de CI @store cria uma sessão do Chrome e conclui a verificação do checkout sem o timeout do WebDriver.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
What are you trying to achieve?
Running tests successfully on our GitHub action Runner : ubuntu-latest container. It was working all good but broke 8 days ago (14th oct 2021)
I tried investigating & observed both this docker images are updated on same date, but reverting them back to older version selenium/hub:: 3.141 & selenium/node-chrome:93.0 didn't helped, got same error attached below
hub:
image: selenium/hub:latest
chrome:
image: selenium/node-chrome:latest
Note : Tests run fine on local machine with same configuration running on CI pipeline.
What do you get instead?
Checkout page verification on Store --
[1] Starting recording promises
**Verifying checkout page - Annual, prepaid @store
[1] Error | Error: Can't connect to WebDriver.
Error: Failed to create session.
Timeout awaiting 'request' for 120000ms
Please make sure Selenium Server is running and accessible
Error: Can't connect to WebDriver.
Error: Failed to create session.
Timeout awaiting 'request' for 120000ms**
Please make sure Selenium Server is running and accessible
Given I am on test site
I am on page "/"
[1] Error | TypeError: Cannot read property 'url' of undefined
[1] Error | TypeError: Cannot read property 'url' of undefined
[1] Error | TypeError: Cannot read property 'url' of undefined
[1] Starting session
[1] Stopping recording promises
› Test failed, try to save a screenshot
› Screenshot has been saved to /__w/web-project-ui-automation-test-framework/web-project-ui-automation-test-framework/output/Verifying__d2382720-3a95-4e87-a5d9-466410c33dc3.failed.png
› <TypeError: Cannot read property 'saveScreenshot' of undefined>
✖ FAILED in 14ms
Provide test source code if related
workflow.yml
name: Build & Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
container:
image: node:14.4
options: --network-alias testHost
env:
NODE_ENV: test
SELENIUM_HUB_HOST: hub
TEST_HOST: testHost
services:
hub:
image: selenium/hub:latest
chrome:
image: selenium/node-chrome:latest
env:
HUB_HOST: hub
HUB_PORT: 4444
strategy:
matrix:
node-version: [14.4]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
scope: '@xyz-technologies'
- name: NPM install
run: npm install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_PAT }}
- name: Run Store Tests
run: npx codeceptjs run --grep @store --reporter mocha-multi --profile https://store.xyz.com/ --config test.codecept.conf.js
- name: Archive mochawesome Test Report
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: mochawesome-test-report
path: ./output
Details
- CodeceptJS version: "3.1.2",
- NodeJS Version: 14.4
- Operating System: Linux ubuntu-latest
- puppeteer || webdriverio || testcafe version (if related) webdriverio
- Configuration file:
const { setHeadlessWhen } = require('@codeceptjs/configure');
const { WAIT_FOR } = require('../constants');
const {
CheckElementPresenceHelper,
VisualTestingHelper,
RelativePathResembleHelper,
} = require('../helpers/index');
require('dotenv').config();
setHeadlessWhen(process.env.CI);
exports.config = {
output: './output',
timeout: WAIT_FOR.STEP, // applies to a single step definition, which should not take longer to run, than specified
helpers: {
CheckElementPresenceHelper,
VisualTestingHelper,
assertWrapper: {
require: require.resolve('codeceptjs-assert'),
},
WebDriver: {
browser: 'chrome',
url: process.env.profile,
coloredLogs: true,
show: true,
restart: true,
host: process.env.host || 'hub',
waitForTimeout: WAIT_FOR.ELEMENT, // wait for the element to reach the state (enabled, existing)
timeouts: {
pageLoad: WAIT_FOR.PAGE, // wait for the page loading to complete
},
smartWait: WAIT_FOR.IMPLICIT, // implicit wait set, when searching for a specific single element, is disables in all other cases (will wait for additional 5 sec)
desiredCapabilities: {
'goog:chromeOptions': {
args: [
'--disable-gpu',
'--window-size=1500,1300',
'--no-sandbox',
'--disable-extensions',
'--dns-prefetch-disable',
'--disable-dev-shm-usage',
],
},
},
},
ResembleHelper: {
require: RelativePathResembleHelper.require,
screenshotFolder: './output/',
relativeToHtmlScreenshotFolder: './',
baseFolder: './output/tests/screenshots/base/',
diffFolder: './output/tests/screenshots/diff/',
relativeToHtmlBaseFolder: './tests/screenshots/base/',
relativeToHtmlDiffFolder: './tests/screenshots/diff/',
},
Mochawesome: {
uniqueScreenshotNames: 'true',
},
},
mocha: {
reporterOptions: {
'codeceptjs-cli-reporter': {
stdout: '-',
options: {
verbose: true,
steps: true,
debug: true,
},
},
mochawesome: {
stdout: './output/console.log',
options: {
steps: true,
reportDir: './output',
json: false,
reportFilename: 'Automated_Test_Run_Report',
inlineAssets: 'true',
saveHtml: 'true',
overwrite: 'true',
},
},
},
},
bootstrap: null,
teardown: null,
hooks: [],
gherkin: {
features: './features/*.feature', // feature files location
steps: './steps/*.js', // step definitions location
},
plugins: {
screenshotOnFail: {
enabled: true, // if true take screenshot of failed scenarios
fullPageScreenshots: false,
},
retryFailedStep: {
enabled: true, // if true rerun failed tests
retries: 2,
ignoredSteps: ['compareActualAndBaseScreenshots'],
},
},
rerun: {
// run 4 times until 1st success
minSuccess: 1,
maxReruns: 2,
},
name: 'codeceptTest',
};
Please suggest what could be wrong..
- Linguagem predominante
- JavaScript
- Estrelas
- 4.2k
- Forks
- 756
- Merge médio
- 1d 6h
- PRs com merge (30d)
- 19
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de codeceptjs/CodeceptJS
-
stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
codeceptjs/CodeceptJS#5420 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
codeceptjs/CodeceptJS#5358 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
codeceptjs/CodeceptJS#4958 · 10 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
stale
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
codeceptjs/CodeceptJS#4778 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
codeceptjs/CodeceptJS#5725 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de codeceptjs/CodeceptJS
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CircuitVerse/CircuitVerse#7967 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
CopilotKit/aimock#491 ·
Mantenedores costumam responder em até 1 dia
-
cvss-severity:high devguard l3montree-cybersecurity/.../devguard-documentation pkg:devguard/l3montree-c.../devguard-documentation risk:low state:open
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
l3montree-dev/devguard-documentation#338 · 1 comentário ·
-
bug runtime spec compliance
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
frostney/GocciaScript#1413 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
keyxmakerx/Chronicle#967 ·
Mantenedores costumam responder em até 1 dia