@cuppet/core 1.0.7 → 1.0.9

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.
@@ -0,0 +1,32 @@
1
+ {
2
+ "id": "test",
3
+ "viewports": [
4
+ {
5
+ "label": "desktop",
6
+ "width": 1920,
7
+ "height": 1080
8
+ }
9
+ ],
10
+ "scenarios": [
11
+ {
12
+ "label": "Single Test",
13
+ "url": "https://example.com"
14
+ }
15
+ ],
16
+ "paths": {
17
+ "bitmaps_reference": "backStopData/bitmaps_reference",
18
+ "bitmaps_test": "backStopData/bitmaps_test",
19
+ "engine_scripts": "backStopData/engine_scripts",
20
+ "html_report": "backStopData/html_report",
21
+ "ci_report": "backStopData/ci_report"
22
+ },
23
+ "report": ["browser"],
24
+ "engine": "puppeteer",
25
+ "engineOptions": {
26
+ "args": ["--headless=new"]
27
+ },
28
+ "asyncCaptureLimit": 5,
29
+ "asyncCompareLimit": 50,
30
+ "debug": false,
31
+ "debugWindow": false
32
+ }
@@ -1,8 +1,8 @@
1
1
  const puppeteer = require('puppeteer');
2
2
 
3
3
  class BrowserManager {
4
- constructor(config, args, credentials) {
5
- this.config = config;
4
+ constructor(viewport, args, credentials) {
5
+ this.viewport = viewport;
6
6
  this.args = args;
7
7
  this.credentials = credentials;
8
8
  this.browser = null;
@@ -30,8 +30,8 @@ class BrowserManager {
30
30
  const isHeadless = this.args.includes('--headless=new');
31
31
  if (isHeadless) {
32
32
  await this.page.setViewport({
33
- width: Number(this.config.width),
34
- height: Number(this.config.height),
33
+ width: Number(this.viewport.width),
34
+ height: Number(this.viewport.height),
35
35
  });
36
36
  }
37
37
  }
@@ -23,3 +23,6 @@ class World {
23
23
  }
24
24
  }
25
25
  setWorldConstructor(World);
26
+
27
+ // Export the World class for use in the main repository
28
+ module.exports = { World };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuppet/core",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Core testing framework components for Cuppet - BDD framework based on Cucumber and Puppeteer",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -8,7 +8,8 @@
8
8
  "features/",
9
9
  "index.js",
10
10
  "stepDefinitions.js",
11
- "postinstall.js"
11
+ "postinstall.js",
12
+ "backStopData/"
12
13
  ],
13
14
  "keywords": [
14
15
  "testing",
@@ -23,8 +24,7 @@
23
24
  "license": "ISC",
24
25
  "peerDependencies": {
25
26
  "@cucumber/cucumber": "^11.0.0",
26
- "config": "^3.3.9",
27
- "puppeteer": "^24.0.1"
27
+ "config": "^3.3.9"
28
28
  },
29
29
  "dependencies": {
30
30
  "@supercharge/strings": "^2.0.0",
@@ -36,7 +36,12 @@
36
36
  "moment": "^2.30.1",
37
37
  "pa11y": "^8.0.0",
38
38
  "pa11y-reporter-html": "^2.0.0",
39
- "xml2js": "^0.6.2"
39
+ "xml2js": "^0.6.2",
40
+ "@wdio/globals": "^9.14.0",
41
+ "appium": "^2.18.0",
42
+ "appium-uiautomator2-driver": "^4.2.3",
43
+ "webdriverio": "9.12.7",
44
+ "puppeteer": "^24.0.1"
40
45
  },
41
46
  "devDependencies": {
42
47
  "@cucumber/cucumber": "^11.0.0",
@@ -44,17 +49,12 @@
44
49
  "@semantic-release/git": "^10.0.1",
45
50
  "@semantic-release/github": "^11.0.3",
46
51
  "@semantic-release/npm": "^12.0.1",
47
- "@wdio/globals": "^9.14.0",
48
- "appium": "^2.18.0",
49
- "appium-uiautomator2-driver": "^4.2.3",
50
52
  "config": "^3.3.9",
51
53
  "eslint": "^9.29.0",
52
54
  "eslint-config-prettier": "^10.1.5",
53
55
  "eslint-plugin-prettier": "^5.5.1",
54
56
  "prettier": "^3.6.1",
55
- "puppeteer": "^24.0.1",
56
- "semantic-release": "^24.2.5",
57
- "webdriverio": "9.12.7"
57
+ "semantic-release": "^24.2.5"
58
58
  },
59
59
  "scripts": {
60
60
  "test": "cucumber-js features/tests",
package/postinstall.js CHANGED
@@ -2,8 +2,8 @@ const fs = require('fs');
2
2
 
3
3
  const isRoot = process.cwd() === process.env.INIT_CWD;
4
4
  if (isRoot) {
5
- fs.mkdirSync('jsonFiles', { recursive: true });
6
- fs.mkdirSync('reports', { recursive: true });
7
- fs.mkdirSync('screenshots', { recursive: true });
8
- console.log('Created jsonFiles, reports, and screenshots folders.');
9
- }
5
+ fs.mkdirSync('jsonFiles', { recursive: true });
6
+ fs.mkdirSync('reports', { recursive: true });
7
+ fs.mkdirSync('screenshots', { recursive: true });
8
+ console.log('Created jsonFiles, reports, and screenshots folders.');
9
+ }
@@ -10,9 +10,10 @@ module.exports = {
10
10
  backstopConfigPrepare: function () {
11
11
  let newConfig = backStopConfig;
12
12
  newConfig.id = process.env.NODE_CONFIG_ENV;
13
- newConfig.viewports[0].width = Number(config.get('viewport.width'));
14
- newConfig.viewports[0].height = Number(config.get('viewport.height'));
15
- newConfig.engineOptions.args = config.get('args');
13
+ const browserViewport = config.get('browserOptions.viewport.backstop');
14
+ newConfig.viewports[0].width = Number(browserViewport.width);
15
+ newConfig.viewports[0].height = Number(browserViewport.height);
16
+ newConfig.engineOptions.args = config.get('browserOptions.args');
16
17
  return newConfig;
17
18
  },
18
19