@openfin/automation-helpers
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "@openfin/automation-helpers", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Helper methods for automation testing in the OpenFin ecosystem", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -58,3 +58,3 @@ # Automation Helpers | ||
it('Can perform operation in the interop window', async () => { | ||
await WebDriver.switchToWindow("Interop Instrument Selection"); | ||
await WebDriver.switchToWindow("title", "Interop Instrument Selection"); | ||
@@ -61,0 +61,0 @@ const elem = await WebDriver.findElementByPath("//h1"); |
export * from "./globals"; | ||
export * from "./models/IWebDriver"; | ||
export * from "./models/IWebDriverElement"; | ||
export * from "./models/IWebDriverWindow"; | ||
export * from "./models/locatorTypes"; | ||
export * from "./models/windowLocatorTypes"; | ||
export * from "./openFin/home"; | ||
export * from "./openFin/me"; | ||
export * from "./openFin/store"; | ||
@@ -11,4 +14,6 @@ export * from "./openFin/system"; | ||
export * from "./webDrivers/nodeWebDriverElement"; | ||
export * from "./webDrivers/nodeWebDriverWindow"; | ||
export * from "./webDrivers/seleniumWebDriver"; | ||
export * from "./webDrivers/seleniumWebDriverElement"; | ||
export * from "./webDrivers/seleniumWebDriverWindow"; | ||
export * from "./webDrivers/webDriver"; |
import type { IWebDriverElement } from "./IWebDriverElement"; | ||
import type { IWebDriverWindow } from "./IWebDriverWindow"; | ||
import type { LocatorTypes } from "./locatorTypes"; | ||
import type { WindowLocatorTypes } from "./windowLocatorTypes"; | ||
/** | ||
@@ -43,15 +45,21 @@ * Web driver interface. | ||
/** | ||
* Switch to a window by its title. | ||
* @param title The window title to switch to. | ||
* @returns True if the window was available. | ||
* @see https://w3c.github.io/webdriver/#dfn-switch-to-window | ||
* Get the details of all the connected windows. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handles | ||
*/ | ||
switchToWindow(title: string): Promise<boolean>; | ||
getWindows(): Promise<IWebDriverWindow[]>; | ||
/** | ||
* Switch to a window by its URL. | ||
* @param url The window url to switch to. | ||
* Get the details of the current window. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handle | ||
*/ | ||
getWindow(): Promise<IWebDriverWindow>; | ||
/** | ||
* Switch to a window by locator. | ||
* @param locator The locator type. | ||
* @param value The window locator value to use. | ||
* @returns True if the window was available. | ||
* @see https://w3c.github.io/webdriver/#dfn-switch-to-window | ||
*/ | ||
switchToWindowByUrl(url: string): Promise<boolean>; | ||
switchToWindow(locator: WindowLocatorTypes, value: string | RegExp): Promise<boolean>; | ||
/** | ||
@@ -58,0 +66,0 @@ * Find an element. |
import { type Client } from "webdriver"; | ||
import type { IWebDriver } from "../models/IWebDriver"; | ||
import type { IWebDriverElement } from "../models/IWebDriverElement"; | ||
import type { IWebDriverWindow } from "../models/IWebDriverWindow"; | ||
import type { LocatorTypes } from "../models/locatorTypes"; | ||
import type { WindowLocatorTypes } from "../models/windowLocatorTypes"; | ||
/** | ||
@@ -54,15 +56,20 @@ * NodeWebDriver for the Node environment. | ||
/** | ||
* Switch to a window by its title. | ||
* @param title The window title to switch to. | ||
* @returns True if the window was available. | ||
* @see https://w3c.github.io/webdriver/#dfn-switch-to-window | ||
* Get the details of all the connected windows. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handles | ||
*/ | ||
switchToWindow(title: string): Promise<boolean>; | ||
getWindows(): Promise<IWebDriverWindow[]>; | ||
/** | ||
* Switch to a window by its URL. | ||
* @param url The window url to switch to. | ||
* Get the details of the current window. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handle | ||
*/ | ||
getWindow(): Promise<IWebDriverWindow>; | ||
/** | ||
* Switch to a window by locator. | ||
* @param locator The locator type. | ||
* @param value The window locator value to use. | ||
* @returns True if the window was available. | ||
* @see https://w3c.github.io/webdriver/#dfn-switch-to-window | ||
*/ | ||
switchToWindowByUrl(url: string): Promise<boolean>; | ||
switchToWindow(locator: WindowLocatorTypes, value: string | RegExp): Promise<boolean>; | ||
/** | ||
@@ -69,0 +76,0 @@ * Find an element. |
@@ -8,3 +8,3 @@ import type { Client } from "webdriver"; | ||
*/ | ||
export declare class NodeWebDriverElement extends BaseWebDriverElement { | ||
export declare class NodeWebDriverElement extends BaseWebDriverElement implements IWebDriverElement { | ||
/** | ||
@@ -11,0 +11,0 @@ * The node web driver to make the chromedriver calls with. |
import { type ThenableWebDriver } from "selenium-webdriver"; | ||
import type { IWebDriver } from "../models/IWebDriver"; | ||
import type { IWebDriverElement } from "../models/IWebDriverElement"; | ||
import type { IWebDriverWindow } from "../models/IWebDriverWindow"; | ||
import type { LocatorTypes } from "../models/locatorTypes"; | ||
import type { WindowLocatorTypes } from "../models/windowLocatorTypes"; | ||
/** | ||
@@ -54,15 +56,20 @@ * Webdriver for the Selenium environment. | ||
/** | ||
* Switch to a window by its title. | ||
* @param title The window title to switch to. | ||
* @returns True if the window was available. | ||
* @see https://w3c.github.io/webdriver/#dfn-switch-to-window | ||
* Get the details of all the connected windows. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handles | ||
*/ | ||
switchToWindow(title: string): Promise<boolean>; | ||
getWindows(): Promise<IWebDriverWindow[]>; | ||
/** | ||
* Switch to a window by its URL. | ||
* @param url The window url to switch to. | ||
* Get the details of the current window. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handle | ||
*/ | ||
getWindow(): Promise<IWebDriverWindow>; | ||
/** | ||
* Switch to a window by locator. | ||
* @param locator The locator type. | ||
* @param value The window locator value to use. | ||
* @returns True if the window was available. | ||
* @see https://w3c.github.io/webdriver/#dfn-switch-to-window | ||
*/ | ||
switchToWindowByUrl(url: string): Promise<boolean>; | ||
switchToWindow(locator: WindowLocatorTypes, value: string | RegExp): Promise<boolean>; | ||
/** | ||
@@ -69,0 +76,0 @@ * Find an element. |
@@ -8,3 +8,3 @@ import type { ThenableWebDriver, WebElement } from "selenium-webdriver"; | ||
*/ | ||
export declare class SeleniumWebDriverElement extends BaseWebDriverElement { | ||
export declare class SeleniumWebDriverElement extends BaseWebDriverElement implements IWebDriverElement { | ||
/** | ||
@@ -11,0 +11,0 @@ * The selenium web driver to make the chromedriver calls with. |
import type { IWebDriverElement } from "../models/IWebDriverElement"; | ||
import type { IWebDriverWindow } from "../models/IWebDriverWindow"; | ||
import type { LocatorTypes } from "../models/locatorTypes"; | ||
import type { WindowLocatorTypes } from "../models/windowLocatorTypes"; | ||
/** | ||
@@ -29,5 +31,5 @@ * Global webdriver wrapper with non driver specific code. | ||
* @param timeoutMs The amount of time to wait for the object. | ||
* @returns The true if the object exists. | ||
* @returns The object if it exists. | ||
*/ | ||
static waitForObjectExisting(objectPath: string, timeoutMs: number): Promise<boolean>; | ||
static waitForObjectExisting<T>(objectPath: string, timeoutMs: number): Promise<T | undefined>; | ||
/** | ||
@@ -50,27 +52,28 @@ * Sleep for the specified milliseconds. | ||
/** | ||
* Switch to a window by its title. | ||
* @param title The window title to switch to. | ||
* @returns True if the window was available. | ||
* Get the details of all the connected windows. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handles | ||
*/ | ||
static switchToWindow(title: string): Promise<boolean>; | ||
static getWindows(): Promise<IWebDriverWindow[]>; | ||
/** | ||
* Switch to a window by its URL. | ||
* @param url The window url to switch to. | ||
* @returns True if the window was available. | ||
* Get the details of the current window. | ||
* @returns The list of windows. | ||
* @see https://w3c.github.io/webdriver/#dfn-get-window-handle | ||
*/ | ||
static switchToWindowByUrl(url: string): Promise<boolean>; | ||
static getWindow(): Promise<IWebDriverWindow>; | ||
/** | ||
* Wait for a window by its title. | ||
* @param title The window title to wait for to. | ||
* @param timeoutMs The maximum amount of time to wait in seconds. | ||
* @returns True if the window was found. | ||
* Switch to a window by locator. | ||
* @param locator The locator type. | ||
* @param value The window locator value to use. | ||
* @returns True if the window was available. | ||
*/ | ||
static waitForWindowByTitle(title: string, timeoutMs: number): Promise<boolean>; | ||
static switchToWindow(locator: WindowLocatorTypes, value: string | RegExp): Promise<boolean>; | ||
/** | ||
* Wait for a window by its URL. | ||
* @param url The window URL to wait for to. | ||
* Wait for a window by its locator. | ||
* @param locator The locator type. | ||
* @param value The window locator value to use. | ||
* @param timeoutMs The maximum amount of time to wait in seconds. | ||
* @returns True if the window was found. | ||
*/ | ||
static waitForWindowByUrl(url: string, timeoutMs: number): Promise<boolean>; | ||
static waitForWindow(locator: WindowLocatorTypes, value: string, timeoutMs: number): Promise<boolean>; | ||
/** | ||
@@ -77,0 +80,0 @@ * Close the current window. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294796
23
3483