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
9 changes: 4 additions & 5 deletions lib/appium-driver.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export declare class AppiumDriver {
defaultWaitTime: number;
readonly capabilities: any;
readonly platformName: any;
readonly platformVesrion: any;
readonly platformVersion: any;
readonly elementHelper: ElementHelper;
readonly locators: Locator;
readonly isAlive: boolean;
Expand Down Expand Up @@ -88,17 +88,16 @@ export declare class AppiumDriver {
findElementsByAccessibilityId(id: string, waitForElement?: number): Promise<UIElement[]>;
/**
* Scrolls from point to other point with minimum inertia
* @param direction
* @param y
* @param x
* @param yOffset
* @param duration
* @param xOffset
*/
scroll(direction: any, SwipeDirection: any, y: number, x: number, yOffset: number, xOffset?: number): Promise<void>;
scroll(direction: Direction, y: number, x: number, yOffset: number, xOffset?: number): Promise<void>;
/**
*
* @param direction
* @param SwipeDirection
* @param element
* @param startPoint
* @param yOffset
Expand All @@ -123,7 +122,7 @@ export declare class AppiumDriver {
logPageSource(fileName: string): Promise<void>;
static createAppiumDriver(port: number, args: INsCapabilities): Promise<AppiumDriver>;
resetApp(): Promise<void>;
inint(): Promise<void>;
init(): Promise<void>;
quit(): Promise<void>;
private convertArrayToUIElements(array, searchM, args);
private static configureLogging(driver, verbose);
Expand Down
23 changes: 11 additions & 12 deletions lib/appium-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export class AppiumDriver {
return this._args.appiumCaps.platformName;
}

get platformVesrion() {
return this._args.appiumCaps.platformVesrion;
get platformVersion() {
return this._args.appiumCaps.platformVersion;
}

get elementHelper() {
Expand Down Expand Up @@ -181,28 +181,27 @@ export class AppiumDriver {

/**
* Scrolls from point to other point with minimum inertia
* @param y
* @param x
* @param yOffset
* @param duration
* @param xOffset
* @param direction
* @param y
* @param x
* @param yOffset
* @param xOffset
*/
public async scroll(direction, SwipeDirection, y: number, x: number, yOffset: number, xOffset: number = 0) {
public async scroll(direction: Direction, y: number, x: number, yOffset: number, xOffset: number = 0) {
scroll(this._wd, this._driver, direction, this._webio.isIOS, y, x, yOffset, xOffset, this._args.verbose);
}

/**
*
* @param direction
* @param SwipeDirection
* @param direction
* @param element
* @param startPoint
* @param yOffset
* @param xOffset
* @param retryCount
*/
public async scrollTo(direction: Direction, element: any, startPoint: Point, yOffset: number, xOffset: number = 0, retryCount: number = 7) {
let el = null
let el = null;
while (el === null && retryCount > 0) {
try {
el = await element();
Expand Down Expand Up @@ -391,7 +390,7 @@ export class AppiumDriver {
await this._driver.resetApp();
}

public async inint() {
public async init() {
await this._driver.init(this._args.appiumCaps);
this._webio.requestHandler.sessionID = this._driver.sessionID;
this._isAlive = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/image-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class ImageHelper {
console.log('Found ' + result.differences + ' differences.');
return resolve(true);
} else {
message = "Screen compare failed!"
message = "Screen compare failed!";
console.log(message);
console.log('Found ' + result.differences + ' differences.');
console.log('Diff image: ' + diffImage);
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const config = (() => {
storage: options.storage || process.env.npm_config_STORAGE || process.env.STORAGE,
testReports: options.testReports || process.env.npm_config_TEST_REPORTS || process.env.TEST_REPORTS,
reuseDevice: options.reuseDevice || process.env.npm_config_REUSE_DEVICE || process.env.REUSE_DEVICE,
}
};

return config;
})();
Expand Down
4 changes: 2 additions & 2 deletions lib/simulator-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { INsCapabilities } from "./ins-capabilities";
const XCRUN = "xcrun ";
const SIMCTL = XCRUN + " simctl ";
const XCRUNLISTDEVICES_COMMAND = SIMCTL + " list devices ";
const BOOT_DEVICE_COMMAND = XCRUN + " instruments -w "
const BOOT_DEVICE_COMMAND = XCRUN + " instruments -w ";
const BOOTED = "Booted";
const SHUTDOWN = "Shutdown";
const OSASCRIPT_QUIT_SIMULATOR_COMMAND = "osascript -e 'tell application \"Simulator\" to quit'";
Expand Down Expand Up @@ -128,7 +128,7 @@ export class SimulatorManager {
}

private static parseSimulator(sim) {
var parts = sim.split(" (");
const parts = sim.split(" (");
if (parts.length < 2) {
return undefined;
}
Expand Down
1 change: 0 additions & 1 deletion lib/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export declare function calculateOffset(direction: any, y: number, yOffset: numb
* @param y
* @param x
* @param yOffset
* @param duration
* @param xOffset
*/
export declare function scroll(wd: any, driver: any, direction: Direction, isIOS: boolean, y: number, x: number, yOffset: number, xOffset: number, verbose: any): Promise<void>;
6 changes: 2 additions & 4 deletions lib/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ export function executeNpmInstall(cwd) {
let spawnArgs = [];
let command = "";
if (isWin()) {
command = "cmd.exe"
command = "cmd.exe";
spawnArgs = ["/c", "npm", "install"];
} else {
command = "npm"
command = "npm";
spawnArgs = ["install"];
}
const npm = childProcess.spawnSync(command, spawnArgs, { cwd: cwd, stdio: "inherit" });
Expand Down Expand Up @@ -293,9 +293,9 @@ export function getAppPath(platform, runType) {
}
} else {
throw new Error("No 'app' capability provided and incorrect 'runType' convention used: " + runType +
". In order to automatically search and locate app package please use 'android','device','sim' in your 'runType' option. E.g --runType android25, --runType sim11iPhone6");
". In order to automatically search and locate app package please use 'android','device','sim' in your 'runType' option. E.g --runType android25, --runType sim.iPhone7.iOS110");
}
};
}

export function calculateOffset(direction, y: number, yOffset: number, x: number, xOffset: number, isIOS: boolean, verbose) {
let speed = 10;
Expand Down Expand Up @@ -345,8 +345,7 @@ export function calculateOffset(direction, y: number, yOffset: number, x: number
* Scrolls from point to other point with minimum inertia
* @param y
* @param x
* @param yOffset
* @param duration
* @param yOffset
* @param xOffset
*/
export async function scroll(wd, driver, direction: Direction, isIOS: boolean, y: number, x: number, yOffset: number, xOffset: number, verbose) {
Expand All @@ -368,7 +367,7 @@ export async function scroll(wd, driver, direction: Direction, isIOS: boolean, y
}

function createStorageFolder(storage, direcotry) {
storage = resolve(storage, direcotry)
storage = resolve(storage, direcotry);
if (!fileExists(storage)) {
fs.mkdirSync(storage);
}
Expand Down