@applitools/spec-driver-selenium 1.5.47 → 1.5.48
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 +12 -0
- package/dist/index.js +3 -3
- package/dist/spec-driver.js +15 -8
- package/package.json +10 -23
- package/types/index.d.ts +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.5.48](https://github.com/applitools/eyes.sdk.javascript1/compare/js/spec-driver-selenium-v1.5.47...js/spec-driver-selenium@1.5.48) (2023-06-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* update some dependencies
|
|
9
|
+
* The following workspace dependencies were updated
|
|
10
|
+
* dependencies
|
|
11
|
+
* @applitools/driver bumped from 1.12.1 to 1.12.2
|
|
12
|
+
* @applitools/utils bumped from 1.3.37 to 1.4.0
|
package/dist/index.js
CHANGED
|
@@ -27,11 +27,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const spec = __importStar(require("./spec-driver"));
|
|
30
|
-
if (!process.env.
|
|
30
|
+
if (!process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION) {
|
|
31
31
|
try {
|
|
32
|
-
const
|
|
32
|
+
const version = process.env.APPLITOOLS_FRAMEWORK_VERSION || require('selenium-webdriver/package.json').version;
|
|
33
33
|
const [major] = version.split('.', 1);
|
|
34
|
-
process.env.
|
|
34
|
+
process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION = major;
|
|
35
35
|
}
|
|
36
36
|
catch {
|
|
37
37
|
// NOTE: ignore error
|
package/dist/spec-driver.js
CHANGED
|
@@ -41,7 +41,7 @@ function isByHashSelector(selector) {
|
|
|
41
41
|
return byHash.includes(Object.keys(selector)[0]);
|
|
42
42
|
}
|
|
43
43
|
async function executeCustomCommand(driver, command) {
|
|
44
|
-
return process.env.
|
|
44
|
+
return process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION === '3'
|
|
45
45
|
? driver.schedule(command)
|
|
46
46
|
: driver.execute(command);
|
|
47
47
|
}
|
|
@@ -77,7 +77,7 @@ function transformDriver(driver) {
|
|
|
77
77
|
driver.getExecutor().defineCommand('getCurrentContext', 'GET', '/session/:sessionId/context');
|
|
78
78
|
driver.getExecutor().defineCommand('getContexts', 'GET', '/session/:sessionId/contexts');
|
|
79
79
|
driver.getExecutor().defineCommand('switchToContext', 'POST', '/session/:sessionId/context');
|
|
80
|
-
if (process.env.
|
|
80
|
+
if (process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION === '3') {
|
|
81
81
|
driver.getExecutor().defineCommand('switchToParentFrame', 'POST', '/session/:sessionId/frame/parent');
|
|
82
82
|
}
|
|
83
83
|
return driver;
|
|
@@ -143,7 +143,7 @@ async function mainContext(driver) {
|
|
|
143
143
|
}
|
|
144
144
|
exports.mainContext = mainContext;
|
|
145
145
|
async function parentContext(driver) {
|
|
146
|
-
if (process.env.
|
|
146
|
+
if (process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION === '3') {
|
|
147
147
|
await executeCustomCommand(driver, new command_1.Command('switchToParentFrame'));
|
|
148
148
|
return driver;
|
|
149
149
|
}
|
|
@@ -283,7 +283,7 @@ async function click(driver, element) {
|
|
|
283
283
|
exports.click = click;
|
|
284
284
|
async function hover(driver, element) {
|
|
285
285
|
const resolvedElement = isSelector(element) ? await findElement(driver, element) : element;
|
|
286
|
-
if (process.env.
|
|
286
|
+
if (process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION === '3') {
|
|
287
287
|
const { ActionSequence } = require('selenium-webdriver');
|
|
288
288
|
const action = new ActionSequence(driver);
|
|
289
289
|
await action.mouseMove(resolvedElement).perform();
|
|
@@ -360,11 +360,18 @@ const browserOptionsNames = {
|
|
|
360
360
|
* When wiring the spec-driver up to an SDK and calling this function, if you don't have the same dev deps
|
|
361
361
|
* installed in the SDK, then this function will error.
|
|
362
362
|
*/
|
|
363
|
-
async function build(
|
|
363
|
+
async function build(env) {
|
|
364
364
|
var _a;
|
|
365
|
-
|
|
365
|
+
let frameworkPath;
|
|
366
|
+
try {
|
|
367
|
+
frameworkPath = require.resolve('selenium-webdriver', { paths: [`${process.cwd()}/node_modules`] });
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
frameworkPath = 'selenium-webdriver';
|
|
371
|
+
}
|
|
372
|
+
const { Builder } = require(frameworkPath);
|
|
366
373
|
const parseEnv = require('@applitools/test-utils/src/parse-env');
|
|
367
|
-
const { browser, capabilities, url, attach, proxy, configurable = true, appium = false, args = [], headless, } = parseEnv({ ...env, legacy: (_a = env.legacy) !== null && _a !== void 0 ? _a : process.env.
|
|
374
|
+
const { browser, capabilities, url, attach, proxy, configurable = true, appium = false, args = [], headless, } = parseEnv({ ...env, legacy: (_a = env.legacy) !== null && _a !== void 0 ? _a : process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION === '3' });
|
|
368
375
|
const desiredCapabilities = { ...capabilities };
|
|
369
376
|
if (configurable) {
|
|
370
377
|
const browserOptionsName = browserOptionsNames[browser || desiredCapabilities.browserName];
|
|
@@ -385,7 +392,7 @@ async function build({ selenium, ...env }) {
|
|
|
385
392
|
if (appium) {
|
|
386
393
|
desiredCapabilities['appium:chromeOptions'] = { w3c: false, ...desiredCapabilities['appium:chromeOptions'] };
|
|
387
394
|
}
|
|
388
|
-
else if (process.env.
|
|
395
|
+
else if (process.env.APPLITOOLS_FRAMEWORK_MAJOR_VERSION === '3') {
|
|
389
396
|
desiredCapabilities['goog:chromeOptions'] = { w3c: false, ...desiredCapabilities['goog:chromeOptions'] };
|
|
390
397
|
}
|
|
391
398
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/spec-driver-selenium",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.48",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"selenium",
|
|
6
6
|
"selenium-webdriver",
|
|
@@ -25,9 +25,6 @@
|
|
|
25
25
|
"name": "Applitools Team",
|
|
26
26
|
"email": "team@applitools.com"
|
|
27
27
|
},
|
|
28
|
-
"aliases": [
|
|
29
|
-
"spec-selenium"
|
|
30
|
-
],
|
|
31
28
|
"exports": {
|
|
32
29
|
".": {
|
|
33
30
|
"types": "./types/index.d.ts",
|
|
@@ -41,29 +38,19 @@
|
|
|
41
38
|
"types"
|
|
42
39
|
],
|
|
43
40
|
"scripts": {
|
|
44
|
-
"lint": "
|
|
45
|
-
"build": "
|
|
46
|
-
"test": "
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"docker:setup": "node ../../scripts/generate-docker-compose-config.js && docker-compose up -d",
|
|
50
|
-
"docker:teardown": "docker-compose down",
|
|
51
|
-
"upgrade:framework": "if [ ! -z $APPLITOOLS_SELENIUM_MAJOR_VERSION ]; then packagejson=`cat package.json`; yarn upgrade --no-lockfile selenium-webdriver@$APPLITOOLS_SELENIUM_MAJOR_VERSION; echo \"$packagejson\" > package.json; fi",
|
|
52
|
-
"deps": "bongo deps",
|
|
53
|
-
"gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='spec-selenium spec-selenium@3' -f links='types utils test-utils'",
|
|
54
|
-
"gh:publish": "gh workflow run publish-spec-selenium.yml --ref $(git rev-parse --abbrev-ref HEAD)",
|
|
55
|
-
"preversion": "bongo preversion",
|
|
56
|
-
"version": "bongo version",
|
|
57
|
-
"postversion": "bongo postversion"
|
|
41
|
+
"lint": "run --top-level eslint '**/*.ts'",
|
|
42
|
+
"build": "run --top-level tspc --project ./tsconfig.build.json",
|
|
43
|
+
"test": "run --top-level mocha './test/**/*.spec.ts' -r @applitools/test-utils/mocha-hooks/docker --exit",
|
|
44
|
+
"setup": "run --top-level browsers:setup",
|
|
45
|
+
"up:framework": "run --top-level add-silent selenium-webdriver"
|
|
58
46
|
},
|
|
59
47
|
"dependencies": {
|
|
60
|
-
"@applitools/driver": "1.12.
|
|
61
|
-
"@applitools/utils": "1.
|
|
48
|
+
"@applitools/driver": "1.12.2",
|
|
49
|
+
"@applitools/utils": "1.4.0"
|
|
62
50
|
},
|
|
63
51
|
"devDependencies": {
|
|
64
52
|
"@applitools/api-extractor": "^1.2.21",
|
|
65
|
-
"@applitools/
|
|
66
|
-
"@applitools/test-utils": "1.5.17",
|
|
53
|
+
"@applitools/test-utils": "^1.5.17",
|
|
67
54
|
"@types/node": "^12.20.55",
|
|
68
55
|
"@types/selenium-webdriver": "^4.1.1",
|
|
69
56
|
"nock": "^13.2.9",
|
|
@@ -75,4 +62,4 @@
|
|
|
75
62
|
"engines": {
|
|
76
63
|
"node": ">=12.13.0"
|
|
77
64
|
}
|
|
78
|
-
}
|
|
65
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export function performAction(driver: Driver, steps: Array<any>): Promise<void>;
|
|
|
55
55
|
export function getCurrentWorld(driver: Driver): Promise<string>;
|
|
56
56
|
export function getWorlds(driver: Driver): Promise<Array<string>>;
|
|
57
57
|
export function switchWorld(driver: Driver, name: string): Promise<void>;
|
|
58
|
-
export function build(
|
|
58
|
+
export function build(env: any): Promise<[import('selenium-webdriver').WebDriver & { __applitoolsBrand?: undefined; } & { __serverUrl?: undefined | string; }, () => Promise<void>]>;
|
|
59
59
|
export type Driver = import('selenium-webdriver').WebDriver & { __applitoolsBrand?: undefined; };
|
|
60
60
|
export type Element = import('selenium-webdriver').WebElement & { __applitoolsBrand?: undefined; };
|
|
61
61
|
export type ShadowRoot = { 'shadow-6066-11e4-a52e-4f735466cecf': string; };
|