|
1 |
| -const { Helper } = require('codeceptjs'); |
| 1 | +const { Helper } = require("codeceptjs"); |
2 | 2 | const resemble = require("resemblejs");
|
3 | 3 | const fs = require("fs");
|
4 | 4 | const assert = require("assert");
|
@@ -30,7 +30,7 @@ interface Options {
|
30 | 30 | needsSameDimension?: boolean;
|
31 | 31 | outputSettings?: any;
|
32 | 32 | prepareBaseImage?: boolean;
|
33 |
| - compareWithImage?: any |
| 33 | + compareWithImage?: any; |
34 | 34 | }
|
35 | 35 |
|
36 | 36 | interface Endpoint {
|
@@ -69,7 +69,7 @@ class ResembleHelper extends Helper {
|
69 | 69 | outputDir = require("codeceptjs").config.get().output || "output";
|
70 | 70 | this.baseFolder = this.resolvePath(config.baseFolder);
|
71 | 71 | this.diffFolder = this.resolvePath(config.diffFolder);
|
72 |
| - this.screenshotFolder = this.resolvePath(config.screenshotFolder || 'output'); |
| 72 | + this.screenshotFolder = this.resolvePath(config.screenshotFolder || "output"); |
73 | 73 | this.prepareBaseImage = config.prepareBaseImage;
|
74 | 74 | }
|
75 | 75 |
|
@@ -230,7 +230,7 @@ class ResembleHelper extends Helper {
|
230 | 230 | */
|
231 | 231 |
|
232 | 232 | async _addAttachment(baseImage: any, misMatch: any, options: Options) {
|
233 |
| - const allure: any = require('codeceptjs').container.plugins("allure"); |
| 233 | + const allure: any = require("codeceptjs").container.plugins("allure"); |
234 | 234 |
|
235 | 235 | if (allure !== undefined && misMatch >= options.tolerance) {
|
236 | 236 | allure.addAttachment("Base Image", fs.readFileSync(this._getBaseImagePath(baseImage, options)), "image/png");
|
@@ -559,25 +559,25 @@ class ResembleHelper extends Helper {
|
559 | 559 | }
|
560 | 560 |
|
561 | 561 | _getHelper() {
|
562 |
| - if (this.helpers['Puppeteer']) { |
563 |
| - return this.helpers['Puppeteer']; |
| 562 | + if (this.helpers["Puppeteer"]) { |
| 563 | + return this.helpers["Puppeteer"]; |
564 | 564 | }
|
565 | 565 |
|
566 |
| - if (this.helpers['WebDriver']) { |
567 |
| - return this.helpers['WebDriver']; |
| 566 | + if (this.helpers["WebDriver"]) { |
| 567 | + return this.helpers["WebDriver"]; |
568 | 568 | }
|
569 |
| - if (this.helpers['Appium']) { |
570 |
| - return this.helpers['Appium']; |
| 569 | + if (this.helpers["Appium"]) { |
| 570 | + return this.helpers["Appium"]; |
571 | 571 | }
|
572 |
| - if (this.helpers['WebDriverIO']) { |
573 |
| - return this.helpers['WebDriverIO']; |
| 572 | + if (this.helpers["WebDriverIO"]) { |
| 573 | + return this.helpers["WebDriverIO"]; |
574 | 574 | }
|
575 |
| - if (this.helpers['TestCafe']) { |
576 |
| - return this.helpers['TestCafe']; |
| 575 | + if (this.helpers["TestCafe"]) { |
| 576 | + return this.helpers["TestCafe"]; |
577 | 577 | }
|
578 | 578 |
|
579 |
| - if (this.helpers['Playwright']) { |
580 |
| - return this.helpers['Playwright']; |
| 579 | + if (this.helpers["Playwright"]) { |
| 580 | + return this.helpers["Playwright"]; |
581 | 581 | }
|
582 | 582 |
|
583 | 583 | throw Error(`No matching helper found. Supported helpers: ${supportedHelper.join("/")}`);
|
|
0 commit comments