Commit Graph
12159 Commits
Author SHA1 Message Date
Jonathan Lipps b49ad93c2c add tests for --force-iphone and --force-ipad 2014-01-21 19:22:31 -08:00
Jonathan Lipps 21b7ac9d56 Merge pull request #1788 from jlipps/master
make toggle test ready for appium test
2014-01-21 19:02:19 -08:00
Jonathan Lipps 8ce088c11a make toggle test ready for appium test
- build it in reset.sh
- move test files to an appropriate dir
- add to test.sh
cc @mobiware
2014-01-21 16:31:20 -08:00
Jonathan Lipps da0919c99c Merge pull request #1769 from mobiware/mobile-toggle
Add mobile: methods on Android: toggleData, toggleFlightMode, toggleWiFi...
2014-01-21 15:00:03 -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 0dceea21bb fix bug where --safari wouldn't pre-launch
and add tests
2014-01-21 14:34:38 -08: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 6354b7f700 Merge pull request #1787 from jlipps/master
misc fixes
2014-01-21 13:16:30 -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 0e73a74651 not sure why we were waiting 30 seconds for instruments to terminate
3 seconds should be more than enough
2014-01-21 12:53:14 -08:00
Jonathan Lipps e2f90d4ba2 actually log no colors when we say not to 2014-01-21 12:24:09 -08:00
Jonathan Lipps 113e796b85 changelog and bump to 0.14.2 for publish v0.14.2 2014-01-21 12:00:38 -08:00
Jonathan Lipps b9de01e350 fix logic mistake
guess i should run some tests before releasing
2014-01-21 12:00:38 -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
Jonathan Lipps fe716b300f changelog and bump to 0.14.1 for publish v0.14.1 2014-01-21 10:57:01 -08:00
Jonathan Lipps 49cfe2e0e3 Merge pull request #1782 from jlipps/ios-prefs
Ios prefs
2014-01-21 10:50:24 -08:00
Jonathan Lipps 3bd3796ee0 ensure we don't set prefs when running a real device 2014-01-21 10:03:26 -08: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
Jonathan Lipps b7e706a93f allow enabling/disabling locationservices via caps 2014-01-20 16:59:55 -08:00
Jonathan Lipps d7860c093d round out settings methods and options 2014-01-20 16:59:55 -08:00
Jonathan Lipps a2482852db set down basic plist key/value options and logic 2014-01-20 16:59:55 -08:00
Jonathan Lipps cfb41f5273 Merge pull request #1781 from bootstraponline/master
android fails to install apk when using old fashion reset
2014-01-20 15:13:25 -08:00
bootstraponline 168445332c fast reset without fast clear requires remote apk to exist 2014-01-20 17:57:31 -05:00
Dan Cuellar d08fde15f6 Merge pull request #1779 from jlipps/master
fix pre-launch bug (fix #1772)
2014-01-20 12:55:17 -08:00
Jonathan Lipps dba5e7393b fix pre-launch bug (fix #1772)
and add tests
2014-01-20 12:43:30 -08:00
Jonathan Lipps e1961db0cf Merge pull request #1776 from rgonalo/master
Fix issue #1775: Selendroid doesn't wait for app-wait-activity
2014-01-20 11:28:05 -08:00
Ruben Gonzalez Alonso 19b2ac545f Fix issue #1775: Selendroid doesn't wait for app-wait-activity 2014-01-20 11:57:52 +01:00
Dan Cuellar 6ff1179897 Merge pull request #1771 from jasonchutko/alertview-notitle
Alerts with no title will return the text as null, instead of the alert's message content.
2014-01-18 05:50:20 -08:00
Jason Chutko f920c9e45b Fixed an issue where alerts with no title will return the text as null, instead of the alert's message content. Similarly, fixed in the converse. 2014-01-17 20:10:14 -08:00
Jonathan Lipps 99155c6321 changelog and bump to 0.14.0 for publish v0.14.0 2014-01-17 14:06:22 -08:00
Jonathan Lipps 3b0d9b49dd reverse test assumption (cc @sebv) 2014-01-17 13:42:31 -08:00
Jonathan Lipps 4d7cac55c9 fix test, this is what i get for using another editor 2014-01-17 12:24:42 -08:00
Jonathan Lipps 0b66158074 make ios tests a bit more robust 2014-01-17 11:39:03 -08:00
Jonathan Lipps 50ad1d0c42 add test for app backgrounding to android/selendroid 2014-01-17 10:57:00 -08: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
Jonathan Lipps 0acc244ca7 Merge pull request #1764 from sebv/extra-caps
Added doc for nativeInstrumentsLib cap
2014-01-16 16:56:54 -08:00
sebv 8952c5bab8 Added doc for nativeInstrumentsLib cap 2014-01-17 08:05:39 +08:00
Jonathan Lipps 1d2211396c Merge pull request #1762 from mobiware/background-android3
Implementing mobile:background command for Android and Selendroid
2014-01-16 15:33:29 -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 0c1b04e41a Merge pull request #1760 from jlipps/master
windows compat fix in android binary finding logic
2014-01-16 12:30:29 -08:00
Jonathan Lipps 0d05436ce2 Merge pull request #1761 from thu2004/master
Return accessibilityHint as element's attribute 'hint'
2014-01-16 12:26:21 -08:00
Jonathan Lipps 7b19a0e12d windows compat fix in android binary finding logic (attempt to fix #1759) 2014-01-16 12:21:29 -08:00
Chi Thu Le f811572a72 Return accessibilityHint as element's attribute 'hint' 2014-01-16 21:21:01 +01: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
Jonathan Lipps cd4051bea6 Merge pull request #1754 from sebv/extra-caps
Native instruments configurable as capabilities
2014-01-16 09:21:28 -08:00
Jonathan Lipps f979f2e51a Merge pull request #1753 from patotskiy/fix_android
Fix android multiple devices: android/android-common.js
2014-01-16 09:14:09 -08:00
Romain Criton 82434a5efe Support full-reset for selendroid
Replay commit ad9c73a3c4
2014-01-16 16:49:33 +00:00
sebv c86606e09c native instruments configurable as capabilities 2014-01-16 20:28:51 +08:00