Skip to content

Commit c5aa24e

Browse files
fix(ui-element): getActualRectangle for Android.
1 parent a10689e commit c5aa24e

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

Diff for: lib/parser.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import { LogImageType } from "./enums/log-image-type";
2-
export declare const projectDir: string, projectBinary: string, pluginRoot: string, pluginBinary: string, port: number, verbose: boolean, appiumCapsLocation: string, testFolder: string, runType: string, isSauceLab: boolean, appPath: string, storage: string, testReports: string, devMode: boolean, ignoreDeviceController: boolean, wdaLocalPort: number, path: string, relaxedSecurity: boolean, cleanApp: boolean, attachToDebug: boolean, sessionId: string, startSession: boolean, capabilitiesName: string, imagesPath: string, startDeviceOptions: string, deviceTypeOrPlatform: string, device: import("mobile-devices-controller/lib/device").IDevice, driverConfig: any, logImageTypes: LogImageType[], appiumCaps: any;
2+
export declare const projectDir: string, projectBinary: string, pluginRoot: string, pluginBinary: string, port: number, verbose: boolean, appiumCapsLocation: string, testFolder: string, runType: string, isSauceLab: boolean, appPath: string, storage: string, testReports: string, devMode: boolean, ignoreDeviceController: boolean, wdaLocalPort: number, path: string, relaxedSecurity: boolean, cleanApp: boolean, attachToDebug: boolean, sessionId: string, startSession: boolean, capabilitiesName: string, imagesPath: string, startDeviceOptions: string, deviceTypeOrPlatform: string, device: any, driverConfig: any, logImageTypes: LogImageType[], appiumCaps: any;

Diff for: lib/ui-element.ts

+9-11
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class UIElement {
4949
* This method is not working very good with UiAutomator2
5050
* It is better to use click instead.
5151
*/
52-
52+
5353
public async tap() {
5454
if (this._args.automationName == AutomationName.UiAutomator2) {
5555
return await this.tapCenter();
@@ -242,16 +242,14 @@ export class UIElement {
242242
*/
243243
public async getActualRectangle() {
244244
const actRect = await this.getRectangle();
245-
if (this._args.isIOS) {
246-
const density = this._args.device.config.density;
247-
if (density) {
248-
actRect.x *= density;
249-
actRect.y *= density;
250-
actRect.width *= density;
251-
actRect.height *= density;
252-
} else {
253-
throw new Error("Device's density is undefined!");
254-
}
245+
const density = this._args.device.config.density;
246+
if (density) {
247+
actRect.x *= density;
248+
actRect.y *= density;
249+
actRect.width *= density;
250+
actRect.height *= density;
251+
} else {
252+
throw new Error("Device's density is undefined!");
255253
}
256254
return actRect;
257255
}

Diff for: samples/e2e-ts/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"experimentalDecorators": true,
66
"emitDecoratorMetadata": true,
77
"importHelpers": false,
8+
"sourceMap": true,
89
"types": [ ],
910
"lib": [
1011
"es2015",

Diff for: samples/e2e-ts/typescript.mocha.sample.e2e-spec.mochawesome.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativ
22
import { assert } from "chai";
33
const addContext = require('mochawesome/addContext');
44

5-
describe("sample scenario", () => {
5+
describe("sample scenario", async function(){
66
let driver: AppiumDriver;
77

88
before(async function(){

0 commit comments

Comments
 (0)