@auxcode/auxta 1.3.51-beta.5 → 1.3.51-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,11 +35,16 @@ class FunctionHelper extends extend_default_page_1.ExtendDefaultPage {
35
35
  }
36
36
  screenshotCompare(key, page = puppeteer_1.default.defaultPage) {
37
37
  return __awaiter(this, void 0, void 0, function* () {
38
- const screenshotBuffer = yield (0, screenshot_helper_1.captureScreenshotPage)(page);
39
- if (screenshotBuffer) {
40
- const screenshot = screenshotBuffer.toString('base64');
41
- yield (0, report_service_1.compareScreenshots)(key, screenshot);
42
- log_service_1.default.push('Then', `compare screenshots with key ${key}`, status_of_step_1.StatusOfStep.PASSED, screenshot, key);
38
+ if (process.env.ENVIRONMENT !== 'LOCAL') {
39
+ const screenshotBuffer = yield (0, screenshot_helper_1.captureScreenshotPage)(page);
40
+ if (screenshotBuffer) {
41
+ const screenshot = screenshotBuffer.toString('base64');
42
+ yield (0, report_service_1.compareScreenshots)(key, screenshot);
43
+ log_service_1.default.push('Then', `compare screenshots with key ${key}`, status_of_step_1.StatusOfStep.PASSED, screenshot, key);
44
+ }
45
+ }
46
+ else {
47
+ log_service_1.default.push('Then', `compare screenshots with key ${key}`, status_of_step_1.StatusOfStep.PASSED, undefined, key);
43
48
  }
44
49
  });
45
50
  }
@@ -25,12 +25,13 @@ const puppeteer = require("puppeteer");
25
25
  class Puppeteer {
26
26
  startBrowser() {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
- let args = [
29
- '--start-maximized'
30
- ];
28
+ let args = [];
31
29
  let env = {};
30
+ if (process.env.ENVIRONMENT === 'LOCAL') {
31
+ args.push('--start-maximized');
32
+ }
32
33
  if (process.env.ENVIRONMENT != 'LOCAL') {
33
- args.push(`--window-size=${config_1.config.screenWidth},${config_1.config.screenHeight}`);
34
+ args.push(`--window-size=${config_1.config.screenWidth ? config_1.config.screenWidth : 1920},${config_1.config.screenHeight ? config_1.config.screenHeight : 1080}`);
34
35
  args.push("--no-sandbox", "--disable-setuid-sandbox", "--disable-gpu");
35
36
  env = {
36
37
  DISPLAY: ":10.0"
@@ -29,11 +29,16 @@ export class FunctionHelper extends ExtendDefaultPage {
29
29
  }
30
30
  screenshotCompare(key, page = puppeteer.defaultPage) {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
- const screenshotBuffer = yield captureScreenshotPage(page);
33
- if (screenshotBuffer) {
34
- const screenshot = screenshotBuffer.toString('base64');
35
- yield compareScreenshots(key, screenshot);
36
- log.push('Then', `compare screenshots with key ${key}`, StatusOfStep.PASSED, screenshot, key);
32
+ if (process.env.ENVIRONMENT !== 'LOCAL') {
33
+ const screenshotBuffer = yield captureScreenshotPage(page);
34
+ if (screenshotBuffer) {
35
+ const screenshot = screenshotBuffer.toString('base64');
36
+ yield compareScreenshots(key, screenshot);
37
+ log.push('Then', `compare screenshots with key ${key}`, StatusOfStep.PASSED, screenshot, key);
38
+ }
39
+ }
40
+ else {
41
+ log.push('Then', `compare screenshots with key ${key}`, StatusOfStep.PASSED, undefined, key);
37
42
  }
38
43
  });
39
44
  }
@@ -18,12 +18,13 @@ import { postNotificationsOnFail } from "../auxta/services/report.service";
18
18
  export class Puppeteer {
19
19
  startBrowser() {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
- let args = [
22
- '--start-maximized'
23
- ];
21
+ let args = [];
24
22
  let env = {};
23
+ if (process.env.ENVIRONMENT === 'LOCAL') {
24
+ args.push('--start-maximized');
25
+ }
25
26
  if (process.env.ENVIRONMENT != 'LOCAL') {
26
- args.push(`--window-size=${config.screenWidth},${config.screenHeight}`);
27
+ args.push(`--window-size=${config.screenWidth ? config.screenWidth : 1920},${config.screenHeight ? config.screenHeight : 1080}`);
27
28
  args.push("--no-sandbox", "--disable-setuid-sandbox", "--disable-gpu");
28
29
  env = {
29
30
  DISPLAY: ":10.0"