Commit Graph

112 Commits

Author SHA1 Message Date
Jonathan Lipps 55ab8f263b say uiautomator exited in logs 2014-02-14 11:28:23 -08:00
Jonathan Lipps 6f4f275180 don't fail test if we can't find strings.xml (fix #1905)
also, make sure apidemos tests run as android even if DEVICE isn't set
2014-02-14 10:54:03 -08:00
Jonathan Lipps a8f247a3d6 Merge pull request #1890 from bootstraponline/android_coverage
Add androidCoverage cap
2014-02-14 09:55:26 -08:00
bootstraponline bbd03f89c6 Add androidCoverage 2014-02-14 12:54:05 -05:00
Isaac Murchie d266d4b7fa Bundle all ChromeDrivers when publishing 2014-02-14 09:50:48 -08:00
Jonathan Lipps d2af7968d7 add ability to scroll ios views
this works on ios7!
2014-02-13 17:38:22 -08:00
Isaac Murchie e9d59b859c Bundle chromedriver into build 2014-02-13 14:16:48 -08:00
Isaac Murchie 9ee3e319af Bundle ChromeDriver into build, for Mac and Linux 2014-02-11 11:47:25 -08: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
bootstraponline 4d7d0533d3 Fix async fullReset on Android
Update docs
2014-02-04 14:25:36 -05:00
Sam Park 72ac77544b Make fullReset clear app on session stop as well 2014-02-04 09:45:09 -08:00
Isaac Murchie ac80afbcc7 Allow multiple ChromeDrivers to be running 2014-02-03 16:49:26 -08:00
Payman Delshad 4c707ad4e3 el.tag_name on Android should return element's className. 2014-02-03 16:01:05 +01:00
Sam Park b5f1b02d3d Add better error message on missing build-tools, include other versions. 2014-02-01 13:33:08 -08:00
bootstraponline afa2928ddf Fix long click on Android
Android's uiautomator has a broken long click implementation.
uiautomator will not pause long enough on long click which causes Android to detect the long click as a normal click.

This fix uses reflection to access uiautomator's private touchDown/touchUp methods to reimplement longClick correctly.

In theory I should be able to obtain a reference to android.app.UiAutomation without using reflection. However this doesn't seem possible when using uiautomator. getInstrumentation().getUiAutomation(); doesn't work because we're not using instrumentation.
2014-01-31 16:31:06 -05:00
Isaac Murchie 5d7a543839 Handle errors in spawn 2014-01-30 11:43:23 -08:00
Isaac Murchie 1ce3ea2b6e Handle non-String input to errorStreamHandler 2014-01-30 11:25:33 -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
Jonathan Lipps da8d64158c fix node logic error preventing unlock errors from propagating in chrome 2014-01-21 14:18:07 -08:00
Jonathan Lipps b4f014ebfe Merge pull request #1784 from thu2004/master
Support mobile method 'launchApp' for selendroid
2014-01-21 12:58:24 -08:00
Jonathan Lipps 954e32a897 Merge pull request #1777 from paymand/ios_drag
Implemented drag for iOS.
2014-01-21 11:43:41 -08:00
Chi Thu Le cf67877598 Support mobile method 'launchApp' for selendroid 2014-01-21 20:01:45 +01:00
Payman Delshad f4a1b6fcaf Implemented drag for iOS.
- Use same drag API on iOS and Android.
- Fixed some indentations.
2014-01-21 10:49:18 +01:00
bootstraponline 168445332c fast reset without fast clear requires remote apk to exist 2014-01-20 17:57:31 -05:00
Ruben Gonzalez Alonso 19b2ac545f Fix issue #1775: Selendroid doesn't wait for app-wait-activity 2014-01-20 11:57:52 +01: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 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
Jonathan Lipps 3b1cc359cb kill chromedriver before starting new chromedriver 2014-01-15 10:31:45 -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
Markyme 9be44a36bc Support Latest SDK
android-4.4 created by default on latest SDK installation
2014-01-12 17:41:03 +02:00
Jonathan Lipps 44b8ed86e0 actually allow removeApp to work with selendroid (fix #1686 for real) 2014-01-10 09:00:51 -08:00
Jonathan Lipps f920a07f10 show selendroid logs in appium output
by making logcat an eventemitter.
also update selendroid test app version
2014-01-08 10:40:18 -08:00
Jonathan Lipps 71ba778bd4 fix selendroid ECONNRESET crashes
by making sure that activities come prepended with a dot.
and add a test
2014-01-08 09:51:57 -08:00
Jonathan Lipps 6d41352d9b bring back closeApp for selendroid (fix #1686) 2014-01-07 09:43:46 -08:00
Jonathan Lipps 5981667cca add support for doing web testing against android stock browser 2014-01-06 18:20:17 -08:00
rockbot 5d88a0eb48 Improves error handling in bootstrap's find.java (fixes #1549) 2014-01-03 11:52:26 -08:00
Jonathan Lipps 0dc74e9874 Merge pull request #1687 from sebv/chrome_fix
Modified session creation to cope with non redirect case
2014-01-03 11:33:01 -08:00
Jonathan Lipps 9594e95554 Merge pull request #1694 from bootstraponline/fix_app_not_responding
Fix app not responding
2014-01-02 18:42:12 -08:00
sebv 7d4b0e5718 fixing spaces 2014-01-03 01:47:50 +08:00
sebv c765cdf7fb Modified session creation to cope with non redirect case 2014-01-02 11:41:31 +08:00
bootstraponline e9cce3f709 Merge pull request #1680 from bootstraponline/keystore
Fix checkApkKeystoreMatch argument order
2013-12-26 18:30:50 -08:00
bootstraponline 9a13665ffb Fix checkApkKeystoreMatch argument order 2013-12-26 21:29:17 -05:00
bootstraponline f1f40fd66a Fix app not responding 2013-12-26 14:01:01 -05:00