Hello,
I am facing an issue with Jenkins pipeline, I have Jenkins file and added command as below:
stage('Start Selenium') {
steps {
dir("${CODECEPTE2E_DIR}") {
container('cloud-tools') {
// Start Selenium
sh "whoami"
sh 'npm install'
sh 'sudo npm install allure-commandline --save-dev'
sh 'docker ps -a'
sh 'docker ps -a'
sh 'docker stop e2etest || true'
sh 'docker rm -v e2etest || true'
sh 'docker stop selenium-chrome || true'
sh 'docker rm --force $(docker ps -aq --filter name=selenium-chrome) || true'
sh 'docker stop codeceptjs || true'
sh 'docker rm --force $(docker ps -aq --filter name=codeceptjs) || true'
sh 'docker run -d -P --shm-size=2g --name selenium-chrome selenium/standalone-chrome:125.0-20240517'
sh 'docker create --shm-size=2g --name codeceptjs codeceptjs/codeceptjs:3.6.0'
sh 'docker ps'
sh "pwd"
// // Run Tests
sh 'docker create --name e2etest -i -v /tests/ --shm-size=2g --link selenium-chrome:selenium codeceptjs/codeceptjs:3.6.0 sh -c "codeceptjs run --steps --config /tests/e2e_codecept/config/allure_tisp_conf.js --grep \'@xfe\' --plugins allure-legacy" && sh -c "npm install allure-commandline --save-dev" && sh -c "npm install @codeceptjs/allure-legacy --save-dev"'
sh 'docker ps'
sh 'sudo npm install allure-commandline --save-dev'
sh 'docker logs e2etest || true'
sh 'docker cp ${CODECEPTE2E_DIR}/ e2etest:/tests/'
sh 'docker start -a e2etest || true'
sh 'docker cp e2etest:/tests/e2e_codecept/output ${CODECEPTE2E_DIR}/allure-results'
sh "ls -lrt ./allure-results/"
sh 'exit 0'
}
}
}
}
But when it is running giving an error related to @codeceptjs/allure-legacy plugin. Error is as below:
+ docker start -a e2etest
creating output directory: /tests/e2e_codecept/output
Could not load plugin allure from module '@codeceptjs/allure-legacy':
Cannot find module '@codeceptjs/allure-legacy'
Require stack:
- /codecept/lib/container.js
- /codecept/lib/codecept.js
- /codecept/bin/codecept.js
Error: Cannot find module '@codeceptjs/allure-legacy'
Require stack:
- /codecept/lib/container.js
- /codecept/lib/codecept.js
- /codecept/bin/codecept.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:119:18)
at createPlugins (/codecept/lib/container.js:303:29)
at Container.create (/codecept/lib/container.js:48:25)
at Codecept.init (/codecept/lib/codecept.js:57:15)
at module.exports (/codecept/lib/command/run.js:31:14)
at Command.<anonymous> (/codecept/bin/codecept.js:36:11)
at Command.listener [as _actionHandler] (/codecept/node_modules/commander/lib/command.js:494:17)
Any help for this issue?
Thanks In advance.