Skip to content

Allure/ Add ability enable screenshotDiff plugin #1551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/plugin/allure.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const defaultConfig = {
* ##### Configuration
*
* * `outputDir` - a directory where allure reports should be stored. Standard output directory is set by default.
* * `enableScreenshotDiffPlugin` - a boolean flag for add screenshot diff to report.
* To attach, tou need to attach three files to the report - "diff.png", "actual.png", "expected.png".
* See [Allure Screenshot Plugin](https://github.com/allure-framework/allure2/blob/master/plugins/screen-diff-plugin/README.md)
*
* #### Public API
*
Expand Down Expand Up @@ -110,6 +113,10 @@ module.exports = (config) => {

event.dispatcher.on(event.test.before, (test) => {
reporter.startCase(test.title);
if (config.enableScreenshotDiffPlugin) {
const currentTest = reporter.getCurrentTest();
currentTest.addLabel('testType', 'screenshotDiff');
}
currentStep = null;
});

Expand Down