Errors pipeline job gitlab with [cypress-allure-adapter] #2760
Replies: 4 comments 2 replies
-
Hello, @qa-hogwarts Also could you please let me know what version of nodejs do you use to run tests. Thank you |
Beta Was this translation helpful? Give feedback.
-
With version 3.2.0, node version error is returned. In my test environment I don't manage the node version |
Beta Was this translation helpful? Give feedback.
-
So, I just realized yo posted it into allure+framework, but page for @mmisty/cypress-allure-adapter is here |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your help, I solved it here by adding the command "yarn add allure-commandline" in "gitlab-ci.yml". One more question: for each spec of tests, the 'allure-results' folder is updated, archiving only the json of the last spec and not of all. Any solution for this? To maintain the 'results' of all tests. |
Beta Was this translation helpful? Give feedback.
-
When running a pipeline with @mmisty, the test runs correctly but returns an error and does not generate results in the allure-results folder
Error job test:
[cypress-allure-adapter] Error running task: 'testStarted': (0 , crypto_1.randomUUID) is not a function
Error job allure-generate-report:
My package.json:
{
"name": "e2e",
"version": "2.0.0",
"description": "e2e",
"main": "index.js",
"scripts": {
"delete:reports": "rm -r report/ | rm -r allure-results/ | rm -r allure-report/",
"pretest": "npm run delete:reports",
"cy:open:painel": "cypress open",
"cy:open:default": "cypress open --env configFile=default",
"cy:open:master": "cypress open --env configFile=master",
"cy:painel-acesso": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/demanda_acesso.spec.js'",
"cy:painel-cards": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/demanda_view_cards.spec.js'",
"cy:painel-andamentos": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/andaments.spec.js'",
"cy:painel-etiquetas": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/cards_gestao.spec.js'",
"cy:painel-paginacao": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/demanda_pages.spec.js'",
"cy:painel-pesquisar": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/pesquisa.spec.js'",
"cy:painel-sidebar": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/sidebar_basica.spec.js'",
"cy:painel-calendario": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/confirmacao.spec.js'",
"cy:painel-upload": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/editor_upload.spec.js'",
"cy:painel-documentos": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/fin_doc.spec.js'",
"cy:painel-anexos": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/anexos.spec.js'",
"cy:painel-workflow": "cypress run --env configFile=default --browser chrome allure=true --spec 'cypress/e2e/workflow.spec.js'",
"doc": "yarn bayon-scripts-docs start",
"doc:build": "yarn bayon-scripts-docs build",
"allure-generate": "allure generate allure-results --clean -o allure-report"
},
"repository": {
"type": "git",
"url": "xxxxxx"
},
"keywords": [
"cypress",
"test",
"automaton",
"e2e",
"allure"
],
"author": "xxxx",
"license": "ISC",
"devDependencies": {
"@mmisty/cypress-allure-adapter": "0.10.0",
"allure-commandline": "^2.30.0",
"cypress": "12.16.0",
"mochawesome": "^6.3.1",
"mochawesome-merge": "^4.2.0",
"moment": "^2.29.1"
},
"dependencies": {
"@bayon-cypress/bayon-cypress-utils": "0.0.35",
"@bayon-cypress/commands-cards": "0.0.35",
"@bayon-cypress/commands-sidebar": "0.0.35",
"@walmyr-filho/cy-press": "^1.0.2",
"allure-js-parser": "^0.0.10",
"cypress-keycloak-commands": "^1.2.0",
"cypress-localstorage-commands": "^1.5.0",
"cypress-plugin-tab": "^1.0.5",
"dotenv": "^16.3.1",
"faker": "^5.5.3"
}
}
My e2e.js:
import '@mmisty/cypress-allure-adapter/support';
require('./commands')
require('cypress-plugin-tab')
require('@walmyr-filho/cy-press')
import addContext from 'mochawesome/addContext';
Cypress.on("test:after:run", (test, runnable) => {
if (test.state === 'failed') {
const screenshotFileName =
${runnable.parent.title} -- ${test.title} (failed).png
;addContext({ test },
assets/${Cypress.spec.name}/${screenshotFileName}
);}
let videoName = Cypress.spec.name
videoName =
${videoName.replace('/.js.*', 'js')}.mp4
addContext({ test },
videos/${videoName}
);})
My gitlab-ci.yml:
allure-generate-report:
stage: merge-report
image: dockerxxxxxx
artifacts:
name: 'results'
when: always
paths:
- allure-results/
- allure-report/
script:
- yarn allure-generate
allow_failure: true
rules:
- when: always
Beta Was this translation helpful? Give feedback.
All reactions