123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- /// <reference types="node"/>
- /// <reference types="webdriver"/>
-
- declare namespace WebDriver {
- interface ChromeOptions {
- /**
- * `devtools` only, switch headless mode by either `headless` flag or `--headless` argument but not both
- */
- headless?: boolean;
- }
-
- interface FirefoxOptions {
- /**
- * `devtools` only, switch headless mode by either `headless` flag or `--headless` argument but not both
- */
- headless?: boolean;
- }
-
- interface MicrosoftEdgeOptions {
- /**
- * `devtools` only, switch headless mode by either `headless` flag or `--headless` argument but not both
- */
- headless?: boolean;
- }
- }
-
- declare namespace DevTools {
- function newSession(
- options?: WebDriver.Options,
- modifier?: (...args: any[]) => any,
- proto?: object,
- commandWrapper?: (commandName: string, fn: (...args: any[]) => any) => any
- ): Promise<Client>;
-
- function reloadSession(
- instance: Client
- ): Promise<Client>;
-
- // generated typings
- // devtools types
- interface Client {
- newSession(capabilities: object): object;
- deleteSession(): void;
- status(): object;
- getTimeouts(): object;
- setTimeouts(implicit?: number, pageLoad?: number, script?: number): void;
- getUrl(): string;
- navigateTo(url: string): string;
- back(): void;
- forward(): void;
- refresh(): void;
- getTitle(): string;
- getWindowHandle(): string;
- closeWindow(): void;
- switchToWindow(handle: string): void;
- createWindow(type: 'tab' | 'window'): object;
- getWindowHandles(): string[];
- printPage(orientation?: string, scale?: number, background?: boolean, width?: number, height?: number, top?: number, bottom?: number, left?: number, right?: number, shrinkToFit?: boolean, pageRanges?: object[]): string;
- switchToFrame(id: (number|object|null)): void;
- switchToParentFrame(): void;
- getWindowRect(): object;
- setWindowRect(x: (number|null), y: (number|null), width: (number|null), height: (number|null)): object;
- maximizeWindow(): object;
- minimizeWindow(): object;
- fullscreenWindow(): object;
- findElement(using: string, value: string): WebDriver.ElementReference[];
- findElements(using: string, value: string): WebDriver.ElementReference[];
- findElementFromElement(using: string, value: string): WebDriver.ElementReference;
- findElementsFromElement(using: string, value: string): WebDriver.ElementReference[];
- getActiveElement(): string;
- isElementSelected(): boolean;
- isElementDisplayed(): boolean;
- getElementAttribute(name: string): string;
- getElementProperty(name: string): string;
- getElementCSSValue(propertyName: string): string;
- getElementText(): string;
- getElementTagName(): string;
- getElementRect(): object;
- isElementEnabled(): boolean;
- elementClick(): void;
- elementClear(): void;
- elementSendKeys(text: string): void;
- getPageSource(): string;
- executeScript(script: string, args?: (string|object|number|boolean|undefined)[]): any;
- executeAsyncScript(script: string, args: (string|object|number|boolean|undefined)[]): any;
- getAllCookies(): object[];
- addCookie(cookie: object): void;
- deleteAllCookies(): void;
- getNamedCookie(name: string): object;
- deleteCookie(name: string): void;
- performActions(actions: object[]): void;
- releaseActions(): void;
- dismissAlert(): void;
- acceptAlert(): void;
- getAlertText(): string;
- sendAlertText(text: string): void;
- takeScreenshot(): string;
- takeElementScreenshot(scroll?: boolean): string;
- getElementComputedRole(): string;
- getElementComputedLabel(): string;
- setPermissions(descriptor: object, state: string, oneRealm?: boolean): void;
- generateTestReport(message: string, group: string): void;
- createMockSensor(mockSensorType: string, maxSamplingFrequency: number, minSamplingFrequency: number): void;
- getMockSensor(type: string): object;
- updateMockSensor(type: string, mockSensorType: string, maxSamplingFrequency: number, minSamplingFrequency: number): void;
- deleteMockSensor(type: string): void;
- setTimeZone(time_zone: string): void;
- addVirtualAuthenticator(protocol?: string, transport?: string, hasResidentKey?: boolean, hasUserVerification?: boolean, isUserConsenting?: boolean, isUserVerified?: boolean, extensions?: object[], uvm?: object[]): void;
- removeVirtualAuthenticator(authenticatorId: string): void;
- addCredential(credentialId: string, isResidentCredential: boolean, rpId: string, privateKey: string, userHandle: string, signCount: number, largeBlob: string): void;
- getCredentials(authenticatorId: string): void;
- removeAllCredentials(authenticatorId: string): void;
- removeCredential(authenticatorId: string, credentialId: string): void;
- setUserVerified(authenticatorId: string, credentialId: string): void;
- }
-
- }
-
- declare module "devtools" {
- export default DevTools;
-
- const SUPPORTED_BROWSER: string[]
- export { SUPPORTED_BROWSER }
- }
|