Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/appium-driver.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export declare class AppiumDriver {
*/
startRecordingVideo(videoName: any): any;
stopRecordingVideo(): Promise<any>;
private compare;
private compare(imageName, timeOutSeconds?, tolerance?, rect?, toleranceType?);
prepareImageToCompare(filePath: string, rect: IRectangle): Promise<void>;
takeScreenshot(fileName: string): Promise<string>;
logScreenshot(fileName: string): Promise<string>;
Expand All @@ -183,10 +183,10 @@ export declare class AppiumDriver {
resetApp(): Promise<void>;
init(): Promise<void>;
quit(): Promise<void>;
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
Expand Down
8 changes: 4 additions & 4 deletions lib/appium-server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export declare class AppiumServer {
readonly server: child_process.ChildProcess;
hasStarted: boolean;
start(port: any, deviceManager?: IDeviceManager): Promise<boolean | this>;
private startAppiumServer;
private startAppiumServer(logLevel, isSauceLab);
stop(): Promise<{}>;
private prepDevice;
private prepApp;
private resolveAppiumDependency;
private prepDevice(deviceManager);
private prepApp();
private resolveAppiumDependency();
}
4 changes: 2 additions & 2 deletions lib/image-helper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>;
clipRectangleImage(rect: IRectangle, path: string): Promise<{}>;
readImage(path: string): Promise<any>;
Expand Down
6 changes: 3 additions & 3 deletions lib/locators.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare class Locator {
readonly image: string;
readonly locators: Map<string, string>;
getElementByName(name: any): string;
private loadAndroidElements;
private loadIOSElements;
private createIosElement;
private loadAndroidElements();
private loadIOSElements();
private createIosElement(element);
}
14 changes: 8 additions & 6 deletions lib/ns-capabilities.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
2 changes: 1 addition & 1 deletion lib/ui-element.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion lib/ui-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,19 @@ 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) {
return false;
}

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;
}

Expand Down