@percy/webdriver-utils 1.32.0-beta.8 → 1.32.0-beta.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.
@@ -27,7 +27,8 @@ export default class PlaywrightDriver {
27
27
  command.script = `/* percy_automate_script */ \n ${command.script}`;
28
28
  }
29
29
  const options = this.requestPostOptions(command);
30
- const baseUrl = `https://cdp.browserstack.com/wd/hub/session/${this.sessionId}/execute`;
30
+ const cdpDomain = process.env.PERCY_CDP_DOMAIN || 'cdp.browserstack.com';
31
+ const baseUrl = `https://${cdpDomain}/wd/hub/session/${this.sessionId}/execute`;
31
32
  const response = JSON.parse((await request(baseUrl, options)).body);
32
33
  return response;
33
34
  }
@@ -98,8 +98,9 @@ export default class AutomateProvider extends GenericProvider {
98
98
  }
99
99
  async setDebugUrl() {
100
100
  if (!this.driver) throw new Error('Driver is null, please initialize driver with createDriver().');
101
+ const automateDomain = process.env.PERCY_AUTOMATE_DOMAIN || 'automate.browserstack.com';
101
102
  this.debugUrl = await Cache.withCache(Cache.bstackSessionDetails, this.driver.sessionId, async () => {
102
- return `https://automate.browserstack.com/builds/${this.automateResults.buildHash}/sessions/${this.automateResults.sessionHash}`;
103
+ return `https://${automateDomain}/builds/${this.automateResults.buildHash}/sessions/${this.automateResults.sessionHash}`;
103
104
  });
104
105
  }
105
106
  async getTag() {
@@ -91,6 +91,12 @@ export default class GenericProvider {
91
91
  }
92
92
  async browserstackExecutor(action, args) {
93
93
  if (!this.driver) throw new Error('Driver is null, please initialize driver with createDriver().');
94
+ if (action === 'percyScreenshot' && process.env.PERCY_ENABLE_DEV === 'true') {
95
+ args = {
96
+ ...args,
97
+ projectId: 'percy-dev'
98
+ };
99
+ }
94
100
  let options = args ? {
95
101
  action,
96
102
  arguments: args
@@ -21,7 +21,8 @@ export default class PlaywrightProvider extends GenericProvider {
21
21
  this.driver = new PlaywrightDriver(this.sessionId);
22
22
  }
23
23
  async setDebugUrl() {
24
- this.debugUrl = `https://automate.browserstack.com/builds/${this.automateResults.buildHash}/sessions/${this.automateResults.sessionHash}`;
24
+ const automateDomain = process.env.PERCY_AUTOMATE_DOMAIN || 'automate.browserstack.com';
25
+ this.debugUrl = `https://${automateDomain}/builds/${this.automateResults.buildHash}/sessions/${this.automateResults.sessionHash}`;
25
26
  }
26
27
  async screenshot(name, options) {
27
28
  let response = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/webdriver-utils",
3
- "version": "1.32.0-beta.8",
3
+ "version": "1.32.0-beta.9",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,8 +29,8 @@
29
29
  "test:coverage": "yarn test --coverage"
30
30
  },
31
31
  "dependencies": {
32
- "@percy/config": "1.32.0-beta.8",
33
- "@percy/sdk-utils": "1.32.0-beta.8"
32
+ "@percy/config": "1.32.0-beta.9",
33
+ "@percy/sdk-utils": "1.32.0-beta.9"
34
34
  },
35
- "gitHead": "8e91413b6ed95aeefad697f058709e2a0fe56f0e"
35
+ "gitHead": "cc176ec0fa5e36551db037a14186ea8b7cd07ff6"
36
36
  }