Skip to content

chore: update mobile-devices-controller #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2019
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
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function stopServer() {
}

if (nsCapabilities.cleanApp && !nsCapabilities.ignoreDeviceController) {
await DeviceController.uninstallApp(nsCapabilities.device, nsCapabilities.appPath);
await DeviceController.uninstallApplication(nsCapabilities.device, nsCapabilities.appPath);
logInfo("Application from device is uninstalled.")
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/device-manager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export declare class DeviceManager implements IDeviceManager {
static getInstalledApps(device: IDevice): Promise<string[]>;
static getDefaultDevice(args: INsCapabilities, deviceName?: string, token?: string, type?: DeviceType, platformVersion?: number): IDevice;
private static convertViewportRectToIRectangle;
static applyAppiumSessionInfoDetails(args: INsCapabilities, sessionInfoDetails: any): any;
static applyAppiumSessionInfoDetails(args: INsCapabilities, sessionInfoDetails: any): IDevice;
static setDontKeepActivities(args: INsCapabilities, driver: any, value: any): Promise<void>;
static executeShellCommand(driver: any, commandArgs: {
command: string;
Expand Down
10 changes: 5 additions & 5 deletions lib/device-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ export class DeviceManager implements IDeviceManager {

public async installApp(args: INsCapabilities): Promise<any> {
if (args.isIOS) {
IOSController.installApp(args.device, args.appiumCaps.app);
IOSController.uninstallApplication(args.device, args.appiumCaps.app);
console.log(`Application is successfully installed!`)
} else {
AndroidController.installApp(args.device, args.appiumCaps.app)
AndroidController.uninstallApplication(args.device, args.appiumCaps.app)
}
}

public async uninstallApp(args: INsCapabilities): Promise<any> {
if (args.isIOS) {
await IOSController.uninstallApp(args.device, args.appPath, args.appiumCaps["bundleId"]);
await IOSController.uninstallApplication(args.device, args.appPath, args.appiumCaps["bundleId"]);
} else {
await Promise.resolve(AndroidController.uninstallApp(args.device, args.appiumCaps["appPackage"]));
await Promise.resolve(AndroidController.uninstallApplication(args.device, args.appiumCaps["appPackage"]));
}
}

Expand Down Expand Up @@ -301,7 +301,7 @@ export class DeviceManager implements IDeviceManager {
}

public getPackageId(device: IDevice, appPath: string): string {
const appActivity = (device.type === DeviceType.EMULATOR || device.platform === Platform.ANDROID) ? AndroidController.getPackageId(appPath) : IOSController.getIOSPackageId(device.type, appPath);
const appActivity = (device.type === DeviceType.EMULATOR || device.platform === Platform.ANDROID) ? AndroidController.getPackageId(appPath) : IOSController.getBundleId(device.type, appPath);
return appActivity;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/parser.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { LogImageType } from "./enums/log-image-type";
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;
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 changes: 1 addition & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ export const prepareApp = async (args: INsCapabilities) => {
&& !args.appiumCaps[appPackage]
&& args.isIOS
&& args.appiumCaps.app) {
args.appiumCaps[appPackage] = IOSController.getIOSPackageId(undefined, args.appiumCaps.app);
args.appiumCaps[appPackage] = IOSController.getBundleId(undefined, args.appiumCaps.app);
}

if (args.appiumCaps[appPackage] && !args.appName) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"frame-comparer": "^2.0.1",
"glob": "^7.1.0",
"inquirer": "^6.2.0",
"mobile-devices-controller": "^4.0.3-8",
"mobile-devices-controller": "~5.0.0",
"wd": "~1.11.3",
"webdriverio": "~4.14.0",
"yargs": "~12.0.5"
Expand All @@ -58,4 +58,4 @@
"test": "mocha --timeout 999999",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
}
}
}
2 changes: 1 addition & 1 deletion test/device-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe("start-device-by-apiLevel", async () => {
await server.start(nsCaps.port);
const driver = await AppiumDriver.createAppiumDriver(nsCaps);

const apps = IOSController.getInstalledApps(nsCaps.device);
const apps = IOSController.getInstalledApplications(nsCaps.device);

const isInstalled = apps.some(app => app.includes(nsCaps.appiumCaps.bundleId));
assert.isTrue(isInstalled);
Expand Down