What are you trying to achieve?
Unique names for screenshots, so they can be transferred to an archive without overwriting each other. The uniqueScreenshotNames for the screenshotOnFail plugin seemed like a good fit so I enabled it.
What do you get instead?
After I run with a failing test, the name of the screenshot is always log_in_as__undefined.failed.png.
$ ls -l /tmp/screenshots/codecept/
total 60
-rw-rw-r-- 1 jon jon 58864 mar 31 11:05 log_in_as__undefined.failed.png
Details
- CodeceptJS version: 2.5.0
- NodeJS Version: 12.8.1
- Operating System: Ubuntu 16.04
- puppeteer
- Configuration file:
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { setHeadlessWhen } = require('@codeceptjs/configure');
// Configuration hooks
setHeadlessWhen(process.env.CI);
exports.config = {
tests: './codecept/spec/*.spec.ts',
output: '/tmp/screenshots/codecept',
helpers: {
Puppeteer: {
url: 'http://localhost:9000',
show: true, // overridden by setHeadlessWhen in CI
waitForNavigation: 'networkidle0',
},
},
include: {
I: './codecept/steps_file.js',
},
bootstrap: null,
mocha: {},
name: 'codecept',
plugins: {
retryFailedStep: {
enabled: true,
},
screenshotOnFail: {
enabled: true,
uniqueScreenshotNames: true,
},
},
require: ['ts-node/register'],
};
What are you trying to achieve?
Unique names for screenshots, so they can be transferred to an archive without overwriting each other. The
uniqueScreenshotNamesfor the screenshotOnFail plugin seemed like a good fit so I enabled it.What do you get instead?
After I run with a failing test, the name of the screenshot is always
log_in_as__undefined.failed.png.Details