@applitools/spec-driver-selenium 1.5.8 → 1.5.10
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/dist/spec-driver.js +12 -11
- package/package.json +2 -2
- package/types/index.d.ts +2 -2
package/dist/spec-driver.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.build = exports.switchWorld = exports.getWorlds = exports.getCurrentWorld = exports.performAction = exports.
|
|
26
|
+
exports.build = exports.switchWorld = exports.getWorlds = exports.getCurrentWorld = exports.performAction = exports.getElementAttribute = exports.getElementRegion = exports.getOrientation = exports.setOrientation = exports.getSystemBars = exports.waitUntilDisplayed = exports.scrollIntoView = exports.hover = exports.click = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getCapabilities = exports.getDriverInfo = exports.getCookies = exports.setWindowSize = exports.getWindowSize = exports.getElementText = exports.setElementText = exports.waitForSelector = exports.findElements = exports.findElement = exports.childContext = exports.parentContext = exports.mainContext = exports.executeScript = exports.isEqualElements = exports.isStaleElementError = exports.untransformSelector = exports.transformSelector = exports.transformDriver = exports.isSelector = exports.isElement = exports.isDriver = void 0;
|
|
27
27
|
const command_1 = require("selenium-webdriver/lib/command");
|
|
28
28
|
const Selenium = __importStar(require("selenium-webdriver"));
|
|
29
29
|
const utils = __importStar(require("@applitools/utils"));
|
|
@@ -185,6 +185,17 @@ async function waitForSelector(driver, selector, _parent, options) {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
exports.waitForSelector = waitForSelector;
|
|
188
|
+
async function setElementText(driver, element, keys) {
|
|
189
|
+
if (isSelector(element))
|
|
190
|
+
element = await findElement(driver, element);
|
|
191
|
+
await element.clear();
|
|
192
|
+
await element.sendKeys(keys);
|
|
193
|
+
}
|
|
194
|
+
exports.setElementText = setElementText;
|
|
195
|
+
async function getElementText(_driver, element) {
|
|
196
|
+
return element.getText();
|
|
197
|
+
}
|
|
198
|
+
exports.getElementText = getElementText;
|
|
188
199
|
async function getWindowSize(driver) {
|
|
189
200
|
try {
|
|
190
201
|
const rect = await driver.manage().window().getRect();
|
|
@@ -289,12 +300,6 @@ async function hover(driver, element) {
|
|
|
289
300
|
}
|
|
290
301
|
}
|
|
291
302
|
exports.hover = hover;
|
|
292
|
-
async function type(driver, element, keys) {
|
|
293
|
-
if (isSelector(element))
|
|
294
|
-
element = await findElement(driver, element);
|
|
295
|
-
await element.sendKeys(keys);
|
|
296
|
-
}
|
|
297
|
-
exports.type = type;
|
|
298
303
|
async function scrollIntoView(driver, element, align = false) {
|
|
299
304
|
if (isSelector(element))
|
|
300
305
|
element = await findElement(driver, element);
|
|
@@ -336,10 +341,6 @@ async function getElementAttribute(_driver, element, attr) {
|
|
|
336
341
|
return element.getAttribute(attr);
|
|
337
342
|
}
|
|
338
343
|
exports.getElementAttribute = getElementAttribute;
|
|
339
|
-
async function getElementText(_driver, element) {
|
|
340
|
-
return element.getText();
|
|
341
|
-
}
|
|
342
|
-
exports.getElementText = getElementText;
|
|
343
344
|
async function performAction(driver, steps) {
|
|
344
345
|
await executeCustomCommand(driver, new command_1.Command('performTouch').setParameters({
|
|
345
346
|
actions: steps.map(({ action, ...options }) => ({ action, options })),
|
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.10",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"selenium",
|
|
6
6
|
"selenium-webdriver",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@applitools/driver": "1.11.
|
|
65
|
+
"@applitools/driver": "1.11.10",
|
|
66
66
|
"@applitools/utils": "1.3.16"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
package/types/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export function childContext(driver: Driver, element: Element): Promise<Driver>;
|
|
|
15
15
|
export function findElement(driver: Driver, selector: Selector, parent?: Element): Promise<Element>;
|
|
16
16
|
export function findElements(driver: Driver, selector: Selector, parent?: Element): Promise<Array<Element>>;
|
|
17
17
|
export function waitForSelector(driver: Driver, selector: Selector, _parent?: Element, options?: import('@applitools/driver').WaitOptions): Promise<Element>;
|
|
18
|
+
export function setElementText(driver: Driver, element: Element | Selector, keys: string): Promise<void>;
|
|
19
|
+
export function getElementText(_driver: Driver, element: Element): Promise<string>;
|
|
18
20
|
export function getWindowSize(driver: Driver): Promise<{ width: number; height: number; }>;
|
|
19
21
|
export function setWindowSize(driver: Driver, size: { width: number; height: number; }): Promise<void>;
|
|
20
22
|
export function getCookies(driver: Driver, context?: boolean): Promise<Array<import('@applitools/driver').Cookie>>;
|
|
@@ -26,7 +28,6 @@ export function visit(driver: Driver, url: string): Promise<void>;
|
|
|
26
28
|
export function takeScreenshot(driver: Driver): Promise<string>;
|
|
27
29
|
export function click(driver: Driver, element: Element | Selector): Promise<void>;
|
|
28
30
|
export function hover(driver: Driver, element: Element | Selector): Promise<void>;
|
|
29
|
-
export function type(driver: Driver, element: Element | Selector, keys: string): Promise<void>;
|
|
30
31
|
export function scrollIntoView(driver: Driver, element: Element | Selector, align: boolean): Promise<void>;
|
|
31
32
|
export function waitUntilDisplayed(driver: Driver, selector: Selector, timeout: number): Promise<void>;
|
|
32
33
|
export function getSystemBars(driver: Driver): Promise<{ statusBar: {
|
|
@@ -51,7 +52,6 @@ export function getElementRegion(_driver: Driver, element: Element): Promise<{
|
|
|
51
52
|
height: number;
|
|
52
53
|
}>;
|
|
53
54
|
export function getElementAttribute(_driver: Driver, element: Element, attr: string): Promise<string>;
|
|
54
|
-
export function getElementText(_driver: Driver, element: Element): Promise<string>;
|
|
55
55
|
export function performAction(driver: Driver, steps: Array<any>): Promise<void>;
|
|
56
56
|
export function getCurrentWorld(driver: Driver): Promise<string>;
|
|
57
57
|
export function getWorlds(driver: Driver): Promise<Array<string>>;
|