Commit Graph

79 Commits

Author SHA1 Message Date
sebv
06d60fc9ee extracted appium-adb npm package 2014-06-03 12:59:15 +08:00
sebv
01a5cfcbb6 bugfixes / test fixes (fixing ci) 2014-05-31 22:13:51 +08:00
Jonathan Lipps
47008fe9e2 ensure we don't get extraneous bits when finding activity
fix #2507
2014-05-30 16:57:16 -07:00
Jonathan Lipps
fa503817fa allow setting of tmp dir appium uses via --tmp flag 2014-05-29 13:33:20 -07:00
Ruben Gonzalez Alonso
6ee18da679 Fix error launching avd 2014-05-13 15:45:15 +02:00
bootstraponline
37b4b667f0 Always setCompressedLayoutHeirarchy 2014-05-12 15:14:31 -04:00
Jonathan Lipps
a69c0478e6 Merge pull request #2529 from penguinho/android-language
Adding language and country support to Android
2014-05-12 08:18:38 -07:00
Dan Cuellar
5401b42d3e Adding language and country support to Android 2014-05-12 07:55:22 -07:00
Jonathan Lipps
802ab048b6 clearer activity error message 2014-05-12 10:44:12 +01:00
bootstraponline
44f92faf50 Output useful information in logger.info 2014-05-07 17:03:42 -04:00
bootstraponline
8f73521d9d Fix double space in log message when not is falsey 2014-05-07 15:41:10 -04:00
Fan Bai
072b5fab53 Fix issue - failed to pass multi params in avdArgs
when passing multiple params in avdArgs, for instance, --avd-args="-port 5564", transfer the value string into array to avoid failures when spawning a new process
2014-05-06 14:17:44 +01:00
Jonathan Lipps
8a5b698e28 bring grunt lint into parity with jshintrc, and fix lint issues 2014-05-01 12:09:17 -07:00
Fan Bai
d9947dad35 Fix issue when iterating the entries
Every time you call entries.pop(), the entries.length minus 1.
We should check entries.length>0 as the end of loop.

This request is same as pull request #2426. fix a typo error.
2014-04-28 09:36:59 -07:00
Payman Delshad
abf26a8fb3 Allow for whitespace in app path. 2014-04-17 11:16:44 -07:00
shyam
aef110413b ApkSigning when using custome keystore fails
ApkSigning fails when using a custom keystore. Looking into the logs I realized that the options to the jarsigner command are not in the right order. Once I made this change the signing went ahead as expected.
2014-04-11 14:47:14 -07:00
Jonathan Lipps
3583347584 camel-case app-(wait-)activity 2014-04-10 15:38:24 -07:00
Jonathan Lipps
5147cbd58c add avdLaunchTimeout/avdReadyTimeout (fix #2247)
and retry launching emulator once if it doesn't connect (fix #1820)
2014-04-04 14:54:06 -07:00
Jonathan Lipps
f4b25accef make sure binaries found using which/where get added to adb.inaries (fix #2237) 2014-04-04 12:06:58 -07:00
Jonathan Lipps
5c265bc459 ensure that app is always force-stopped before uninstalling apk (fix #1757) 2014-03-25 13:28:28 -07:00
bootstraponline
75faec10e5 Fix EXDEV error when using renameSync to move 2014-03-24 09:42:43 -04:00
Jonathan Lipps
d0456ff938 Merge pull request #2099 from rgonalo/master
Allow to have more than one emulator started
2014-03-20 16:20:05 -07:00
Ruben Gonzalez Alonso
b47154f89e Wait for emulator is ready after launching it 2014-03-20 16:39:38 +01:00
Ruben Gonzalez Alonso
872cf19c43 Allow to have more than one emulator started 2014-03-20 16:39:30 +01:00
Jonathan Lipps
de567ae5da make sure the tempdir exists before trying to write aligned apk to it 2014-03-19 10:52:01 -07:00
Ruben Gonzalez Alonso
c4006189a4 Print all errors while starting emulator 2014-03-19 18:41:20 +01:00
Ruben Gonzalez Alonso
b805773310 Add --avd-args option to launch avd with additional args 2014-03-19 18:41:20 +01:00
bootstraponline
9abcd247d6 Fix android process detection 2014-03-19 12:44:30 -04:00
bootstraponline
1e71cf8c30 Fix Android uninstall detection
API 19 uses the following stdout message:

WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
Success

That broke the simple stdout === 'Success' check.
2014-03-18 09:51:27 -04:00
Jonathan Lipps
255ad390b0 Merge pull request #2028 from bootstraponline/android_default
Parse Android package and launch activity from apk
2014-03-17 09:37:20 -07:00
bootstraponline
9fd7718707 Parse Android package and launch activity from apk
Update logging

Add null guard

Prevent null waitPkg
2014-03-16 00:14:25 -04:00
bootstraponline
40c8c6b8bc Ensure apks are run through zipalign 2014-03-15 15:44:29 -04:00
sebv
be6f77b354 Added timeout to uninstallApk 2014-03-11 21:46:26 +08:00
Jonathan Lipps
896083a849 Merge pull request #1948 from paymand/logcat_udid
Fixed logcat capture for multiple devices.
2014-02-25 12:50:25 -08:00
Payman Delshad
13b4e2c1e7 Fixed logcat capture for multiple devices. 2014-02-25 09:45:59 +01:00
Jonathan Lipps
d498d7df31 fix some failing android tests 2014-02-24 16:58:04 -08:00
Jonathan Lipps
21c9242fb6 finish android hybrid support
and refactor android webview tests to work for android as well as selendroid
2014-02-24 14:59:40 -08:00
Jonathan Lipps
a698e19d2c stub out some functions used to get webviews going on android 2014-02-24 14:59:39 -08:00
bootstraponline
bbd03f89c6 Add androidCoverage 2014-02-14 12:54:05 -05:00
Ruben Gonzalez Alonso
c1df6cb62f Fix error installing unlock app if there are spaces in Appium folder 2014-02-11 16:23:48 +01:00
Isaac Murchie
6daff9e810 Add app wait package 2014-02-04 15:35:58 -08:00
Sam Park
b5f1b02d3d Add better error message on missing build-tools, include other versions. 2014-02-01 13:33:08 -08:00
Isaac Murchie
5d7a543839 Handle errors in spawn 2014-01-30 11:43:23 -08:00
sebv
d971f72c46 stricter jshint rules enforcable from editor 2014-01-29 14:03:34 +08:00
Romain Criton
1b488f74e0 Add mobile: methods on Android: toggleData, toggleFlightMode, toggleWiFi, toggleLocationServices
Original commit message: didLaunch flag is set at the end of launch sequence

"Ping" ADB to check whether we're still connected

On Android Emulator, ADB is disconnected when we toggle Airplane Mode
or mobile Data. However, the problem does not manifest itself when
querying the list of devices via adb devices: the emulator is still
listed. After attempting to ping the emulator via a shell command, the
emulator is no longer listed and a kill-server is necessary to get ADB
back up and running

Partial recovery from a loss of ADB connection caused by turning off the data connection in the emulator

Conditionnally restart UI Automator in case of unexpected exit, mainly to address the use case of disconnecting the netwok on Android Emulator, which triggers a loss of ADB connection, and subsequently UI Automator connection

New method mobile: toggleData on Android

toggleData method on iOS

toggleFlightMode method

Make toggleData and toggleFlightMode mobile methods available for Selendroid

Fix indentation

Make sure we recover from ADB connection loss on Selendroid when disabling data on emulator

On Android emulator the ADB connection is lost when we disable the data
connection. On Android the ADB connection loss is handled by the UI
Automator exit handler, on Selendroid it must be handled in the toggle
method

Fixed indentation

Fixed ping method

Do not look for exact match in stdout

Reset uiautomatorRestartOnExit flag after we've disabled data connection

Refactor UI Automator exit handler and add a flag to completely ignore UI Automator exit

When we disconnect the network (via either disabling 3G or enabling
Flight Mode), the official Android emulator loses the ADB connection.
However, sometimes the UI Automator exit handler is not called until
the next attempt to send an ADB command. So we introduce a flag to tell
the UI automator exit handler to do nothing, i.e. neither restart UI
Automator nor uninstall the app, we take care of ADB and UI automator
reconnection before sending the next ADB command

Refactor toggleSetting code and handle ADB reconnection

Refactored the toggleSetting code in order to separate the code common
to both Android subplatforms, and code specific to either platforms
(UIAutomator and Selendroid)
Made sure UI Automator restart is handled in the toggleSetting code and
not in the UI Automator exit handler

Selendroid method for handling ADB disconnection in Emulator when turning network connection off

Right keyevent combination to position the focus on Airplane Mode checkbox for API <= 15

On Android 4.1+ (API 16+) there's a "Parent" button in the
AIRPLANE_MODE_SETTINGS Activity's ActionBar, whereas on earlier
versions there's no "Parent" button, so we need to take this into
account when performing the key sequence to position the focus on the
Airplane Mode checkbox

Generic mechanism to let each "toggle" method provide the sequence of key to position the focus

Each "toggle" mobile method may require a different sequence of keys in
order to position the focus within the corresponding Settings Activity.
Now this sequence is dynamically provided by each "toggle" method

mobile: toggleWiFi implementation

Remove blank line

mobile: toggleLocationServices implementation

When toggling LocationServices ON there's a dialog asking for user
confirmation, so we introduce a mechanism that lokks for this dialog
and acknowledge it, but if the dialog doesn't show up we proceed to
exit the settings activity

Adapt key sequence for toggleLocationServices on Android API 16

Fix bug on Kitkat when re-enabling Location Services

On Kitkat when re-entering the Location Services Activity after
disabling it, no UI element has the focus and no key press can let the
target switch grab the focus. The workaround is to make sure an element
has the focus by issuing a key press prior to opening the Location
Services activity.

Fix lint error (mixed tabs and spaces)

Fix lint error (mixed tabs and spaces)

Add comments

Spaces after if

Move variable definition

Shorten variable names

Remove dead code

Move restartAdb method to ADB (and rename to restart)

Rename rr variable to err

Android Test app for "mobile: toggle…" methods

Test script for "mobile: toggle…" methods

Refactoring of toggle test script to avoid code duplication

Adding other toggle methods

Fix lint warning

Handle an unexpected exit of logcat (for instance if ADB itself exits unexpectedly)

Make sure we can restart logcat after stoping it

Stop and restart logcat when restarting ADB

Fix UiAutomator state variable to prevent blocking when restarting UiAutomator

Refactored toggle test to allow testing on both Android and Selendroid

Get rid of the arbitrary timeout to account for ADB disconnection on emulator

When disconnecting the network connection through the "mobile: toggle"
methods, we no longer wait for an arbitrary period of time for the ADB
connection to go down.
Instead, we forcibly shut down ADB and restart it
2014-01-21 22:42:40 +00:00
bootstraponline
365543575a Merge pull request #1765 from jlipps/fix-max-stack
fix max call stack in keytool zip issue
2014-01-16 19:36:05 -08:00
Jonathan Lipps
21fb8b2d9e use a messy loop instead of a deeply nested async fn chain (fix #1523) 2014-01-16 17:50:35 -08:00
Romain Criton
2d161528d8 Implementing mobile:background command for Android and Selendroid
Replay commit 1c6b495cd2

Remove debug log

Tidy up spaces according to pull request review

Fixed indentation according to Appium project style guide (2 spaces indent)

Fixed error management in background method

Add an argument to ADB.startApp in order to choose whether to stop the app prior to starting it

Conflicts:
	lib/devices/android/adb.js

Refactored mobile:background method for Android: using ADB.startApp rather than directly issuing am start command to ADB shell, do not return to callback until app is back to foreground

Mimick the launcher start intent for the app when starting it

The Android launcher uses the following settings to start apps:
- MAIN action
- LAUNCHER category
- FLAG_ACTIVITY_NEW_TASK
- FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
Without those settings there were discrepancies between Selendroid and
Android when trying to bring the app back to foreground: it would not
bring back the existing Activity stack but create new activities

Adapt background code to new startApp signature

Added "retry" argument

Missing space

Spaces after if

Fixed spacing issue

Split long line
2014-01-16 22:59:57 +00:00
Jonathan Lipps
7b19a0e12d windows compat fix in android binary finding logic (attempt to fix #1759) 2014-01-16 12:21:29 -08:00
Jonathan Lipps
a9841062e0 fix selendroid app launch issues
require a dot for a relative activity, otherwise we consider it a full one
2014-01-13 15:54:16 -08:00