Skip to content

Commit a3c852f

Browse files
wvegterenVasil Chimev
authored andcommitted
fixed some typos + some cleanup (#38)
1 parent c37ae7e commit a3c852f

File tree

8 files changed

+27
-33
lines changed

8 files changed

+27
-33
lines changed

lib/appium-driver.d.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export declare class AppiumDriver {
2525
defaultWaitTime: number;
2626
readonly capabilities: any;
2727
readonly platformName: any;
28-
readonly platformVesrion: any;
28+
readonly platformVersion: any;
2929
readonly elementHelper: ElementHelper;
3030
readonly locators: Locator;
3131
readonly isAlive: boolean;
@@ -88,17 +88,16 @@ export declare class AppiumDriver {
8888
findElementsByAccessibilityId(id: string, waitForElement?: number): Promise<UIElement[]>;
8989
/**
9090
* Scrolls from point to other point with minimum inertia
91+
* @param direction
9192
* @param y
9293
* @param x
9394
* @param yOffset
94-
* @param duration
9595
* @param xOffset
9696
*/
97-
scroll(direction: any, SwipeDirection: any, y: number, x: number, yOffset: number, xOffset?: number): Promise<void>;
97+
scroll(direction: Direction, y: number, x: number, yOffset: number, xOffset?: number): Promise<void>;
9898
/**
9999
*
100100
* @param direction
101-
* @param SwipeDirection
102101
* @param element
103102
* @param startPoint
104103
* @param yOffset
@@ -123,7 +122,7 @@ export declare class AppiumDriver {
123122
logPageSource(fileName: string): Promise<void>;
124123
static createAppiumDriver(port: number, args: INsCapabilities): Promise<AppiumDriver>;
125124
resetApp(): Promise<void>;
126-
inint(): Promise<void>;
125+
init(): Promise<void>;
127126
quit(): Promise<void>;
128127
private convertArrayToUIElements(array, searchM, args);
129128
private static configureLogging(driver, verbose);

lib/appium-driver.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export class AppiumDriver {
6464
return this._args.appiumCaps.platformName;
6565
}
6666

67-
get platformVesrion() {
68-
return this._args.appiumCaps.platformVesrion;
67+
get platformVersion() {
68+
return this._args.appiumCaps.platformVersion;
6969
}
7070

7171
get elementHelper() {
@@ -181,28 +181,27 @@ export class AppiumDriver {
181181

182182
/**
183183
* Scrolls from point to other point with minimum inertia
184-
* @param y
185-
* @param x
186-
* @param yOffset
187-
* @param duration
188-
* @param xOffset
184+
* @param direction
185+
* @param y
186+
* @param x
187+
* @param yOffset
188+
* @param xOffset
189189
*/
190-
public async scroll(direction, SwipeDirection, y: number, x: number, yOffset: number, xOffset: number = 0) {
190+
public async scroll(direction: Direction, y: number, x: number, yOffset: number, xOffset: number = 0) {
191191
scroll(this._wd, this._driver, direction, this._webio.isIOS, y, x, yOffset, xOffset, this._args.verbose);
192192
}
193193

194194
/**
195195
*
196-
* @param direction
197-
* @param SwipeDirection
196+
* @param direction
198197
* @param element
199198
* @param startPoint
200199
* @param yOffset
201200
* @param xOffset
202201
* @param retryCount
203202
*/
204203
public async scrollTo(direction: Direction, element: any, startPoint: Point, yOffset: number, xOffset: number = 0, retryCount: number = 7) {
205-
let el = null
204+
let el = null;
206205
while (el === null && retryCount > 0) {
207206
try {
208207
el = await element();
@@ -391,7 +390,7 @@ export class AppiumDriver {
391390
await this._driver.resetApp();
392391
}
393392

394-
public async inint() {
393+
public async init() {
395394
await this._driver.init(this._args.appiumCaps);
396395
this._webio.requestHandler.sessionID = this._driver.sessionID;
397396
this._isAlive = true;

lib/image-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class ImageHelper {
4545
console.log('Found ' + result.differences + ' differences.');
4646
return resolve(true);
4747
} else {
48-
message = "Screen compare failed!"
48+
message = "Screen compare failed!";
4949
console.log(message);
5050
console.log('Found ' + result.differences + ' differences.');
5151
console.log('Diff image: ' + diffImage);

lib/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const config = (() => {
4545
storage: options.storage || process.env.npm_config_STORAGE || process.env.STORAGE,
4646
testReports: options.testReports || process.env.npm_config_TEST_REPORTS || process.env.TEST_REPORTS,
4747
reuseDevice: options.reuseDevice || process.env.npm_config_REUSE_DEVICE || process.env.REUSE_DEVICE,
48-
}
48+
};
4949

5050
return config;
5151
})();

lib/simulator-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { INsCapabilities } from "./ins-capabilities";
55
const XCRUN = "xcrun ";
66
const SIMCTL = XCRUN + " simctl ";
77
const XCRUNLISTDEVICES_COMMAND = SIMCTL + " list devices ";
8-
const BOOT_DEVICE_COMMAND = XCRUN + " instruments -w "
8+
const BOOT_DEVICE_COMMAND = XCRUN + " instruments -w ";
99
const BOOTED = "Booted";
1010
const SHUTDOWN = "Shutdown";
1111
const OSASCRIPT_QUIT_SIMULATOR_COMMAND = "osascript -e 'tell application \"Simulator\" to quit'";
@@ -128,7 +128,7 @@ export class SimulatorManager {
128128
}
129129

130130
private static parseSimulator(sim) {
131-
var parts = sim.split(" (");
131+
const parts = sim.split(" (");
132132
if (parts.length < 2) {
133133
return undefined;
134134
}

lib/utils.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export declare function calculateOffset(direction: any, y: number, yOffset: numb
2828
* @param y
2929
* @param x
3030
* @param yOffset
31-
* @param duration
3231
* @param xOffset
3332
*/
3433
export declare function scroll(wd: any, driver: any, direction: Direction, isIOS: boolean, y: number, x: number, yOffset: number, xOffset: number, verbose: any): Promise<void>;

lib/utils.js

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ export function executeNpmInstall(cwd) {
7272
let spawnArgs = [];
7373
let command = "";
7474
if (isWin()) {
75-
command = "cmd.exe"
75+
command = "cmd.exe";
7676
spawnArgs = ["/c", "npm", "install"];
7777
} else {
78-
command = "npm"
78+
command = "npm";
7979
spawnArgs = ["install"];
8080
}
8181
const npm = childProcess.spawnSync(command, spawnArgs, { cwd: cwd, stdio: "inherit" });
@@ -293,9 +293,9 @@ export function getAppPath(platform, runType) {
293293
}
294294
} else {
295295
throw new Error("No 'app' capability provided and incorrect 'runType' convention used: " + runType +
296-
". In order to automatically search and locate app package please use 'android','device','sim' in your 'runType' option. E.g --runType android25, --runType sim11iPhone6");
296+
". 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");
297297
}
298-
};
298+
}
299299

300300
export function calculateOffset(direction, y: number, yOffset: number, x: number, xOffset: number, isIOS: boolean, verbose) {
301301
let speed = 10;
@@ -345,8 +345,7 @@ export function calculateOffset(direction, y: number, yOffset: number, x: number
345345
* Scrolls from point to other point with minimum inertia
346346
* @param y
347347
* @param x
348-
* @param yOffset
349-
* @param duration
348+
* @param yOffset
350349
* @param xOffset
351350
*/
352351
export async function scroll(wd, driver, direction: Direction, isIOS: boolean, y: number, x: number, yOffset: number, xOffset: number, verbose) {
@@ -368,7 +367,7 @@ export async function scroll(wd, driver, direction: Direction, isIOS: boolean, y
368367
}
369368

370369
function createStorageFolder(storage, direcotry) {
371-
storage = resolve(storage, direcotry)
370+
storage = resolve(storage, direcotry);
372371
if (!fileExists(storage)) {
373372
fs.mkdirSync(storage);
374373
}

0 commit comments

Comments
 (0)