diff --git a/lib/appium-driver.d.ts b/lib/appium-driver.d.ts index 0403180..4581d48 100644 --- a/lib/appium-driver.d.ts +++ b/lib/appium-driver.d.ts @@ -163,7 +163,7 @@ export declare class AppiumDriver { */ startRecordingVideo(videoName: any): any; stopRecordingVideo(): Promise; - private compare; + private compare(imageName, timeOutSeconds?, tolerance?, rect?, toleranceType?); prepareImageToCompare(filePath: string, rect: IRectangle): Promise; takeScreenshot(fileName: string): Promise; logScreenshot(fileName: string): Promise; @@ -183,10 +183,10 @@ export declare class AppiumDriver { resetApp(): Promise; init(): Promise; quit(): Promise; - private static applyAdditionalSettings; - private convertArrayToUIElements; - private static configureLogging; - private getExpectedImagePath; + private static applyAdditionalSettings(args); + private convertArrayToUIElements(array, searchM, args); + private static configureLogging(driver, verbose); + private getExpectedImagePath(imageName); /** * Wait specific amount of time before continue execution * @param miliseconds diff --git a/lib/appium-server.d.ts b/lib/appium-server.d.ts index 149bde1..3c2c1d2 100644 --- a/lib/appium-server.d.ts +++ b/lib/appium-server.d.ts @@ -15,9 +15,9 @@ export declare class AppiumServer { readonly server: child_process.ChildProcess; hasStarted: boolean; start(port: any, deviceManager?: IDeviceManager): Promise; - private startAppiumServer; + private startAppiumServer(logLevel, isSauceLab); stop(): Promise<{}>; - private prepDevice; - private prepApp; - private resolveAppiumDependency; + private prepDevice(deviceManager); + private prepApp(); + private resolveAppiumDependency(); } diff --git a/lib/image-helper.d.ts b/lib/image-helper.d.ts index 5b2d5df..7d6ba5c 100644 --- a/lib/image-helper.d.ts +++ b/lib/image-helper.d.ts @@ -18,8 +18,8 @@ export declare class ImageHelper { width: any; height: any; }; - private static getOffsetPixels; - private runDiff; + private static getOffsetPixels(args); + private runDiff(diffOptions, diffImage); compareImages(actual: string, expected: string, output: string, valueThreshold?: number, typeThreshold?: any): Promise; clipRectangleImage(rect: IRectangle, path: string): Promise<{}>; readImage(path: string): Promise; diff --git a/lib/locators.d.ts b/lib/locators.d.ts index 124d2a9..d4f7f3b 100644 --- a/lib/locators.d.ts +++ b/lib/locators.d.ts @@ -8,7 +8,7 @@ export declare class Locator { readonly image: string; readonly locators: Map; getElementByName(name: any): string; - private loadAndroidElements; - private loadIOSElements; - private createIosElement; + private loadAndroidElements(); + private loadIOSElements(); + private createIosElement(element); } diff --git a/lib/ns-capabilities.d.ts b/lib/ns-capabilities.d.ts index 03f328d..47dc095 100644 --- a/lib/ns-capabilities.d.ts +++ b/lib/ns-capabilities.d.ts @@ -37,6 +37,7 @@ export declare class NsCapabilities implements INsCapabilities { private _device; private _deviceManager; private _exceptions; + private _imagesPath; constructor(_parser: INsCapabilitiesArgs); readonly path: string; readonly projectDir: string; @@ -70,13 +71,14 @@ export declare class NsCapabilities implements INsCapabilities { readonly startSession: boolean; deviceManager: IDeviceManager; readonly isValidated: boolean; + readonly imagesPath: string; extend(args: INsCapabilities): this; validateArgs(): void; - private isAndroidPlatform; - private shouldSetFullResetOption; - private setAutomationName; + private isAndroidPlatform(); + private shouldSetFullResetOption(); + private setAutomationName(); tryGetAndroidApiLevel(): number; - private resolveApplication; - private checkMandatoryCapabiliies; - private throwExceptions; + private resolveApplication(); + private checkMandatoryCapabiliies(); + private throwExceptions(); } diff --git a/lib/ui-element.d.ts b/lib/ui-element.d.ts index 1df0439..e62797c 100644 --- a/lib/ui-element.d.ts +++ b/lib/ui-element.d.ts @@ -9,7 +9,7 @@ export declare class UIElement { private _args; private _searchMethod; private _searchParams; - private _index?; + private _index; constructor(_element: any, _driver: any, _wd: any, _webio: any, _args: INsCapabilities, _searchMethod: string, _searchParams: string, _index?: number); /** * Click on element diff --git a/lib/ui-element.ts b/lib/ui-element.ts index 2c1efb9..1feedd1 100644 --- a/lib/ui-element.ts +++ b/lib/ui-element.ts @@ -92,6 +92,7 @@ export class UIElement { * Shows if element is displayed. Returns true or false. If the element doesn't exist it will return false */ public async isDisplayed() { + const displaySize = await this._driver.getWindowSize(); const el = (await this.element()); let isDisplayed = true; if (!el || el === null) { @@ -99,8 +100,11 @@ export class UIElement { } try { - isDisplayed = (await el.isDisplayed()); + const elemCoordinates = await this.getRectangle(); + isDisplayed = (await el.isDisplayed()) && elemCoordinates.x >= 0 && elemCoordinates.x < displaySize.width + && elemCoordinates.y >= 0 && elemCoordinates.y < displaySize.height; } catch (error) { + console.log("ERROR: " + error); isDisplayed = false; }