@cuppet/core 1.0.8 → 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.
@@ -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.8",
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": [
@@ -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