Commit Graph

51 Commits

Author SHA1 Message Date
bootstraponline ce6b4f0867 uninstall before install remote apk 2014-05-23 13:31:19 -04:00
bootstraponline af89c29947 Merge pull request #2545 from rgonalo/getStrings
Get localized strings in Android, Selendroid and iOS
2014-05-13 06:40:46 -07:00
sebv 877b0db1c6 fixing jscs styling error 2014-05-13 19:03:17 +08:00
Ruben Gonzalez Alonso be347e9257 Check updateStrings errors and improve parseLocalizableStrings in iOS 2014-05-13 09:59:24 +02:00
Ruben Gonzalez Alonso 858b4a30e9 Add optional argument 'language' to getStrings in Android and Selendroid 2014-05-13 09:58:05 +02:00
Ruben Gonzalez Alonso 72d0237ab9 Extract strings from apk and add getStrings method on selendroid 2014-05-13 09:58:03 +02:00
Ruben Gonzalez Alonso 35cfc47e1e Extract strings from apk corresponding to device language instead of default to be used with ID location strategy in Android 2014-05-13 09:58:03 +02:00
bootstraponline 37b4b667f0 Always setCompressedLayoutHeirarchy 2014-05-12 15:14:31 -04:00
Dan Cuellar 5401b42d3e Adding language and country support to Android 2014-05-12 07:55:22 -07:00
bootstraponline 22993148b5 Enable compress xml by default for Android XPath 2014-05-08 09:48:49 -04:00
Jonathan Lipps 55100ce28b camel-case device-ready-timeout (fix #2268) 2014-04-10 15:41:26 -07:00
Jonathan Lipps 3583347584 camel-case app-(wait-)activity 2014-04-10 15:38:24 -07:00
Jonathan Lipps 318617819f change app-package and app-wait-package to appPackage and appWaitPackage 2014-04-10 15:20:24 -07:00
Jonathan Lipps e1fe06ceb5 inner cbs need proper scope (cc @sebv) 2014-04-07 11:25:11 -07:00
Jonathan Lipps 645cc62d61 if installing a remote apk fails, uninstall/rm and retry (fix #2188) 2014-04-04 15:43:43 -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
sebv 4702906186 allowing app paths relative to appium root 2014-04-05 02:11:45 +08:00
Jonathan Lipps 5c265bc459 ensure that app is always force-stopped before uninstalling apk (fix #1757) 2014-03-25 13:28:28 -07:00
Jonathan Lipps 0b4554ce4e Merge pull request #2162 from bootstraponline/reset_from_cap
Enable fullReset and noReset from caps
2014-03-25 12:51:06 -07:00
bootstraponline 6995aa868f Set fullReset and noReset from caps 2014-03-25 15:47:36 -04:00
Payman Delshad 48a8110bcb Make sure the app is always signed *before* getting the MD5 hash. 2014-03-25 14:01:14 +01:00
Payman Delshad a9d1e74f63 Removed 'fastClear' capability.
No need for 'fastClear' anymore. Current modes are:
1. fullReset: Reinstall the app.
2. noReset: Don't reinstall, keep app data.
3. fastReset (!fullReset && !noReset): Don't reinstall the app, but clear the app data (pm clear).
2014-03-21 13:02:43 +01:00
Ruben Gonzalez Alonso 872cf19c43 Allow to have more than one emulator started 2014-03-20 16:39:30 +01:00
Ruben Gonzalez Alonso b805773310 Add --avd-args option to launch avd with additional args 2014-03-19 18:41:20 +01:00
Jonathan Lipps 482d24e0e1 add packageAndLaunchActivity support for selendroid
also convert our tests to use this by default so that it's tested
also move it to after prepareDevice so we make sure to run adb commands
with the appropriate device id etc
fix #2083, cc @bootstraponline
2014-03-17 15:15:48 -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
Jonathan Lipps b058732ebb port android basic config 2014-03-03 16:40:16 -08:00
Jonathan Lipps 0cd14dd8fd rearchitect configuration methods 2014-03-03 16:37:49 -08:00
Isaac Murchie 6daff9e810 Add app wait package 2014-02-04 15:35:58 -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 168445332c fast reset without fast clear requires remote apk to exist 2014-01-20 17:57:31 -05: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 8334ef5e65 Merge pull request #1755 from mobiware/full-reset2
Support full-reset for selendroid (2nd take)
2014-01-16 09:58:11 -08:00
Romain Criton 82434a5efe Support full-reset for selendroid
Replay commit ad9c73a3c4
2014-01-16 16:49:33 +00:00
patotskiy 30af76744d Fix android multiple devices: android/android-common.js 2014-01-16 14:06:26 +03:00
rockbot 79fb97ba60 first attempt at fixing appium avd startup bug 2013-12-23 10:03:52 -08:00
Jonathan Lipps 20e1580362 adb shell doesn't return exit codes so we need to specifically look for this failure 2013-12-19 15:53:22 -08:00
bootstraponline ca96a526ce Fix spacing 2013-12-18 21:44:20 -05:00
rockbot 005f9ac1ac changes md5 module for more efficient md5hashing 2013-12-18 17:13:14 -08:00
Jonathan Lipps e207483a25 allow alternative type of clear through fastClear: false cap
fix #1514
2013-11-21 13:33:13 -08:00
Chi Thu Le f8e2909ed2 Moved getCurrentActivity to android-common.js 2013-11-08 20:39:37 +01:00
Jonathan Lipps d29ea809ba move logcat code into android-common
so that selendroic an use it as well
2013-11-06 11:12:59 -08:00
Jonathan Lipps fe61ec8b8c fix unlock retry logic so we actually unlock (fix #1295) 2013-10-24 10:41:55 -07:00
Jonathan Lipps d2a362118a fix a bunch of refactoring issues 2013-10-22 11:29:19 -07:00
Jonathan Lipps d63671ceee finish main rewrite of adb.js 2013-10-22 11:29:19 -07:00
Jonathan Lipps 1140908666 run commands from uiautomator.js, and migrate activity waiting methods 2013-10-22 11:29:19 -07:00
Jonathan Lipps 389ae73e9a migrate push unlock and push appium 2013-10-22 11:29:18 -07:00
Jonathan Lipps 30b2c69ff6 migrate port forward logic 2013-10-22 11:29:18 -07:00
Jonathan Lipps 65bb08d84e finish migrating install logic 2013-10-22 11:29:18 -07:00