Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b5626dd

Browse files
fix: apiLevel of devices
1 parent 19a7cc2 commit b5626dd

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

‎lib/appium-driver.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ export class AppiumDriver {
185185
}
186186

187187
public async navBack() {
188+
if (this.isAndroid) {
189+
logInfo("=== Navigate back with hardware button!");
190+
} else {
191+
logInfo("=== Navigate back.");
192+
}
188193
return await this._driver.back();
189194
}
190195

‎lib/device-manager.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export declare class DeviceManager implements IDeviceManager {
1313
static getInstalledApps(device: IDevice): Promise<string[]>;
1414
static getDefaultDevice(args: INsCapabilities, deviceName?: string, token?: string, type?: DeviceType, platformVersion?: number): IDevice;
1515
private static convertViewportRectToIRectangle;
16-
static applyAppiumSessionInfoDetails(args: INsCapabilities, sessionInfoDetails: any): any;
16+
static applyAppiumSessionInfoDetails(args: INsCapabilities, sessionInfoDetails: any): IDevice;
1717
static setDontKeepActivities(args: INsCapabilities, driver: any, value: any): Promise<void>;
1818
static executeShellCommand(driver: any, commandArgs: {
1919
command: string;

‎lib/device-manager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class DeviceManager implements IDeviceManager {
197197
const sizeArr = sessionInfoDetails.deviceScreenSize.split("x");
198198
args.device.deviceScreenSize = { width: sizeArr[0], height: sizeArr[1] };
199199

200-
args.device.apiLevel = sessionInfoDetails.deviceApiLevel;
200+
args.device.apiLevel = sessionInfoDetails.deviceApiLevel||args.device.apiLevel;
201201
args.device.deviceScreenDensity = sessionInfoDetails.deviceScreenDensity / 100;
202202
args.device.config = { "density": args.device.deviceScreenDensity || args.device.config.density, "offsetPixels": +sessionInfoDetails.statBarHeight || args.device.config.offsetPixels };
203203
} else {
@@ -218,14 +218,14 @@ export class DeviceManager implements IDeviceManager {
218218
const status = value ? 1 : 0;
219219
try {
220220
if (args.isAndroid) {
221-
if (!args.ignoreDeviceController) {
222-
AndroidController.setDontKeepActivities(value, args.device);
223-
} else if (args.relaxedSecurity) {
221+
if (args.relaxedSecurity) {
224222
const output = await DeviceManager.executeShellCommand(driver, { command: "settings", args: ['put', 'global', 'always_finish_activities', status] });
225223
console.log(`Output from setting always_finish_activities to ${status}: ${output}`);
226224
//check if set
227225
const check = await DeviceManager.executeShellCommand(driver, { command: "settings", args: ['get', 'global', 'always_finish_activities'] });
228226
console.info(`Check if always_finish_activities is set correctly: ${check}`);
227+
} else if (!args.ignoreDeviceController) {
228+
AndroidController.setDontKeepActivities(value, args.device);
229229
}
230230
} else {
231231
// Do nothing for iOS ...

‎lib/parser.d.ts

Lines changed: 1 addition & 1 deletion
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: any, 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: import("mobile-devices-controller/lib/device").IDevice, driverConfig: any, logImageTypes: LogImageType[], appiumCaps: any;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /