@applitools/spec-driver-webdriver 1.4.2 → 1.4.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.4](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-webdriver@1.4.3...js/spec-driver-webdriver@1.4.4) (2025-09-09)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/utils bumped to 1.12.0
9
+ #### Features
10
+
11
+ * enable canvas with webgl for autonomous | FLD 3515 ([#3197](https://github.com/Applitools-Dev/sdk/issues/3197)) ([23f22e5](https://github.com/Applitools-Dev/sdk/commit/23f22e517d52dc70f24093dfb21e072b9aa9fb60))
12
+ * @applitools/logger bumped to 2.2.3
13
+
14
+ * @applitools/driver bumped to 1.23.4
15
+
16
+ * @applitools/test-server bumped to 1.3.2
17
+
18
+
19
+ ## [1.4.3](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-webdriver@1.4.2...js/spec-driver-webdriver@1.4.3) (2025-08-21)
20
+
21
+
22
+ ### Dependencies
23
+
24
+ * @applitools/driver bumped to 1.23.3
25
+ #### Bug Fixes
26
+
27
+ * make orientation more robust | FLD-3470 ([#3166](https://github.com/Applitools-Dev/sdk/issues/3166)) ([3745427](https://github.com/Applitools-Dev/sdk/commit/37454279234b085dc9a159077b3f278cdccc203a))
28
+
3
29
  ## [1.4.2](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-webdriver@1.4.1...js/spec-driver-webdriver@1.4.2) (2025-08-12)
4
30
 
5
31
 
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.build = exports.switchWorld = exports.getWorlds = exports.getCurrentWorld = exports.takeScreenshot = exports.performAction = exports.visit = exports.getUrl = exports.getTitle = exports.getCookies = exports.getSystemBars = exports.setOrientation = exports.getOrientation = exports.setViewportSize = exports.setWindowSize = exports.getWindowSize = exports.getCapabilities = exports.getDriverInfo = exports.childContext = exports.parentContext = exports.mainContext = exports.click = exports.hover = exports.getElementText = exports.setElementText = exports.getElementAttribute = exports.getElementRegion = exports.findElements = exports.findElement = exports.executeBrowserCommands = exports.executeScript = exports.toSimpleCommonSelector = exports.toSelector = exports.toElement = exports.toDriver = exports.isStaleElementError = exports.isEqualElements = exports.isSelector = exports.isShadowRoot = exports.isSecondaryElement = exports.isElement = exports.isSecondaryDriver = exports.isDriver = void 0;
29
+ exports.build = exports.switchWorld = exports.getWorlds = exports.getCurrentWorld = exports.takeScreenshot = exports.performAction = exports.visit = exports.getUrl = exports.getTitle = exports.getCookies = exports.getSystemBars = exports.setOrientation = exports.getOrientation = exports.setViewportSize = exports.setWindowSize = exports.getWindowSize = exports.getCapabilities = exports.getDriverInfo = exports.childContext = exports.parentContext = exports.mainContext = exports.click = exports.hover = exports.getElementText = exports.setElementText = exports.getElementAttribute = exports.getElementRegion = exports.findElements = exports.findElement = exports.executeBrowserCommands = exports.executeScript = exports.toSimpleCommonSelector = exports.toSelector = exports.toElement = exports.toDriver = exports.isStaleElementError = exports.isEqualElements = exports.isSelector = exports.isShadowRoot = exports.isSecondaryElement = exports.isElement = exports.isSecondaryDriver = exports.isDriver = exports.buildWebDriverProxyCapabilities = exports.getProxyConfiguration = void 0;
30
30
  const url_1 = require("url");
31
31
  const http_proxy_agent_1 = __importDefault(require("http-proxy-agent"));
32
32
  const https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
@@ -94,6 +94,7 @@ function getFrameworkMajorVersion() {
94
94
  function getWebDriver() {
95
95
  return getFrameworkMajorVersion() < 8 ? require('webdriver').default : require('webdriver');
96
96
  }
97
+ // Exported for testing
97
98
  function getProxyConfiguration() {
98
99
  const httpProxy = utils.general.getEnvCaseInsensitive('HTTP_PROXY');
99
100
  const httpsProxy = utils.general.getEnvCaseInsensitive('HTTPS_PROXY');
@@ -106,6 +107,7 @@ function getProxyConfiguration() {
106
107
  httpsUrl: new URL(httpsProxy !== null && httpsProxy !== void 0 ? httpsProxy : httpProxy),
107
108
  };
108
109
  }
110
+ exports.getProxyConfiguration = getProxyConfiguration;
109
111
  function getAgents(httpUrl, httpsUrl) {
110
112
  const httpProxyOptions = { ...(0, url_1.parse)(httpUrl.href), rejectUnauthorized: false };
111
113
  const httpAgent = (0, http_proxy_agent_1.default)(httpProxyOptions);
@@ -116,6 +118,28 @@ function getAgents(httpUrl, httpsUrl) {
116
118
  });
117
119
  return { httpAgent, httpsAgent };
118
120
  }
121
+ // Exported for testing
122
+ function buildWebDriverProxyCapabilities(proxyConfig, noProxy) {
123
+ if (proxyConfig.hasProxy && noProxy) {
124
+ const httpProxyPort = proxyConfig.httpUrl.port || (proxyConfig.httpUrl.protocol === 'https:' ? '443' : '80');
125
+ const httpsProxyPort = proxyConfig.httpsUrl.port || (proxyConfig.httpsUrl.protocol === 'https:' ? '443' : '80');
126
+ return {
127
+ proxyType: 'manual',
128
+ httpProxy: `${proxyConfig.httpUrl.hostname}:${httpProxyPort}`,
129
+ sslProxy: `${proxyConfig.httpsUrl.hostname}:${httpsProxyPort}`,
130
+ noProxy: noProxy,
131
+ };
132
+ }
133
+ else if (!proxyConfig.hasProxy && noProxy) {
134
+ // NO_PROXY exists but no HTTP_PROXY - configure WebDriver to use system proxy with bypass
135
+ return {
136
+ proxyType: 'system',
137
+ noProxy: noProxy,
138
+ };
139
+ }
140
+ return null;
141
+ }
142
+ exports.buildWebDriverProxyCapabilities = buildWebDriverProxyCapabilities;
119
143
  function isDriver(driver) {
120
144
  if (!driver)
121
145
  return false;
@@ -553,9 +577,23 @@ async function build(env) {
553
577
  };
554
578
  }
555
579
  const proxyConfig = getProxyConfiguration();
580
+ const noProxy = utils.general.getEnvCaseInsensitive('NO_PROXY');
556
581
  if (proxyConfig.hasProxy) {
557
582
  const { httpAgent, httpsAgent } = getAgents(proxyConfig.httpUrl, proxyConfig.httpsUrl);
558
583
  options.agent = { http: httpAgent, https: httpsAgent };
584
+ // Configure WebDriver proxy capabilities if NO_PROXY is present
585
+ const proxyCapabilities = buildWebDriverProxyCapabilities(proxyConfig, noProxy);
586
+ if (proxyCapabilities) {
587
+ options.capabilities.proxy = proxyCapabilities;
588
+ }
589
+ }
590
+ else if (noProxy) {
591
+ // NO_PROXY exists but no HTTP_PROXY - configure WebDriver to use system proxy with bypass
592
+ const proxyCapabilities = buildWebDriverProxyCapabilities(proxyConfig, noProxy);
593
+ if (proxyCapabilities) {
594
+ options.capabilities.proxy = proxyCapabilities;
595
+ }
596
+ options.agent = { https: require('https').Agent({ rejectUnauthorized: false }) };
559
597
  }
560
598
  else {
561
599
  options.agent = { https: require('https').Agent({ rejectUnauthorized: false }) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/spec-driver-webdriver",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "keywords": [
5
5
  "webdriver",
6
6
  "chrome devtools protocol",
@@ -49,14 +49,14 @@
49
49
  "up:framework": "echo \"$(jq '.devDependencies.webdriver = $ENV.APPLITOOLS_FRAMEWORK_VERSION' ./package.json)\" > ./package.json"
50
50
  },
51
51
  "dependencies": {
52
- "@applitools/driver": "1.23.2",
53
- "@applitools/utils": "1.11.1",
52
+ "@applitools/driver": "1.23.4",
53
+ "@applitools/utils": "1.12.0",
54
54
  "http-proxy-agent": "5.0.0",
55
55
  "https-proxy-agent": "5.0.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@applitools/api-extractor": "^1.2.22",
59
- "@applitools/test-server": "^1.3.1",
59
+ "@applitools/test-server": "^1.3.2",
60
60
  "@applitools/test-utils": "^1.5.17",
61
61
  "@types/node": "^12.20.55",
62
62
  "nock": "^13.3.2",
package/types/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  declare const _default: SpecDriver;
2
2
  export default _default;
3
+ export function getProxyConfiguration(): { hasProxy: boolean; httpUrl: null | URL; httpsUrl: null | URL; };
4
+ export function buildWebDriverProxyCapabilities(proxyConfig: { hasProxy: boolean; httpUrl: null | URL; httpsUrl: null | URL; }, noProxy: undefined | string): null | { proxyType: string; httpProxy?: undefined | string; sslProxy?: undefined | string; noProxy?: undefined | string; };
3
5
  export function isDriver(driver: any): driver is Driver<unknown>;
4
6
  export function isSecondaryDriver(driver: any): driver is StaticDriver<unknown>;
5
7
  export function isElement(element: any): element is Element;