Skip to content
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

Adding apk-utilities and functional and unit tests for it #83

Merged
merged 1 commit into from
Jun 11, 2015

Conversation

moizjv
Copy link
Member

@moizjv moizjv commented Jun 11, 2015

@jlipps @sebv please review.

  • Adding apk-utilities
  • Adding functional tests
  • Adding unit tests

log.errorAndThrow("activity and pkg is required for launching application");
}
// initializing defaults
_.defaults(startAppOptions, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better clone the options before using defaults. It is modifying startAppOptions.
(https://lodash.com/docs#defaults)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlipps and I discussed this. It ok to modify startAppOptions. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's ok, makes it complicate to track side effects.

@sebv
Copy link
Member

sebv commented Jun 11, 2015

Few comments, otherwise 👍

let apiLevel = await this.getApiLevel();
let thirdparty = apiLevel >= 15 ? "-3" : "";
let stdout = await this.shell(['pm', 'list', 'packages', thirdparty, pkg]);
let apkInstalledRgx = new RegExp('^package:' + pkg.replace(/(\.)/g, "\\$1") +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use an interpolated string here?

@imurchie
Copy link
Contributor

In general, looks good!

@moizjv moizjv force-pushed the 2.0 branch 2 times, most recently from 26dc7d5 to 4c4fdde Compare June 11, 2015 18:30
log.errorAndThrow("Permission to start activity denied.");
}
if (startAppOptions.waitActivity) {
if (startAppOptions.hasOwnProperty("waitDuration")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just get rid of this if/else?

await this.waitForActivity(startAppOptions.waitPkg, startAppOptions.waitActivity, startAppOptions.waitDuration);

if startAppOptions doesn't have a waitDuration, then it will pass undefined, which is exactly the same thing as not passing it at all.

@jlipps
Copy link
Member

jlipps commented Jun 11, 2015

made my comments

moizjv added a commit that referenced this pull request Jun 11, 2015
Adding apk-utilities and functional and unit tests for it
@moizjv moizjv merged commit 39cb79b into appium:2.0 Jun 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants