Hi,
I struggling to run my visual tests in docker container.
I am able to run functional tests without codeceptjs-resemblehelper helper in docker.
I am able to run visual tests without docker container.
I have codeceptjs-resemblehelper module added.
Tried to give the absolute path. REquired module manually. Nothing helped.
SImple docker command
docker run --net=host -v “$(pwd):/tests” codeception/codeceptjs codeceptjs run
also tried to give direct path formount
All I got is this
Could not load helper ResembleHelper from module 'codeceptjs-resemblehelper':
Cannot find module 'codeceptjs-resemblehelper'
Require stack:
- /codecept/lib/container.js
- /codecept/lib/codecept.js
- /codecept/bin/codecept.js
Error:
at createHelpers (/codecept/lib/container.js:166:13)
at Function.create (/codecept/lib/container.js:42:25)
at Codecept.init (/codecept/lib/codecept.js:57:15)
at Command.module.exports (/codecept/lib/command/run.js:28:14)
at Command.listener (/codecept/node_modules/commander/index.js:315:8)
at Command.emit (events.js:209:13)
at Command.parseArgs (/codecept/node_modules/commander/index.js:651:12)
at Command.parse (/codecept/node_modules/commander/index.js:474:21)
at Object.<anonymous> (/codecept/bin/codecept.js:228:9)
at Module._compile (internal/modules/cjs/loader.js:936:30)
Isolated issue by creating a basic project.
My config
const { setHeadlessWhen } = require(’@codeceptjs/configure’);
// turn on headless mode when running with HEADLESS=true environment variable
// HEADLESS=true npx codecept run
setHeadlessWhen(process.env.HEADLESS);
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
Puppeteer: {
url: 'https://www.ss.lv/',
show: true,
windowSize: '1200x900',
chrome: {args: ['--no-sandbox']}
},
"ResembleHelper" : {
"require": "codeceptjs-resemblehelper",
"screenshotFolder" : "./tests/output/",
"baseFolder": "./tests/screenshots/base/",
"diffFolder": "./tests/screenshots/diff/"
}
},
include: {
I: './steps_file.js'
},
bootstrap: null,
mocha: {},
name: 'Tests2',
plugins: {
retryFailedStep: {
enabled: true
},
screenshotOnFail: {
enabled: true
}
}
}