Commit Graph

54 Commits

Author SHA1 Message Date
Jonathan Lipps
d8d0a26706 fix lint errors 2014-05-06 14:15:39 +01:00
sebv
1df406033e Using Async.queue to queue commands 2014-04-28 13:01:04 -07:00
Jonathan Lipps
318617819f change app-package and app-wait-package to appPackage and appWaitPackage 2014-04-10 15:20:24 -07:00
sebv
4702906186 allowing app paths relative to appium root 2014-04-05 02:11:45 +08:00
Dylan Lacey
148336fc04 Use the new capabilities throughout the codebase.
Every entry in `Capabilities.capabilityConversions` is now used to
convert capabilities into the args array.

Change version to versionVersion.
Change device to platformName
Stop aliasing platformVersion to version in Capabilities.js
2014-04-01 16:42:28 -07:00
Isaac Murchie
f4f730e1ee Use contexts for switching native/web 2014-03-19 21:13:47 -07:00
bootstraponline
9abcd247d6 Fix android process detection 2014-03-19 12:44:30 -04: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
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
sebv
f61a321d2e bugfix, context was wrong 2014-03-11 21:44:59 +08: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
Jonathan Lipps
bcf9d6c60e create Device class and abstract configuration logic into each type of device to clean up appium.js 2014-03-03 16:37:49 -08:00
bootstraponline
591c0dbc4e Fix Android page source 2014-02-27 10:19:50 -05:00
jonahss
31b3fc99ae fix issue #1798: commands fail after stopping and relaunching app. 2014-02-25 18:01:02 -08: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
cedac5d8b7 work on getting chromedriver accessing webviews 2014-02-24 14:59:39 -08:00
Jonathan Lipps
67b522e6c4 start setting up concept of webviews for android 2014-02-24 14:59:39 -08:00
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
bootstraponline
bbd03f89c6 Add androidCoverage 2014-02-14 12:54:05 -05: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
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
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
Romain Criton
82434a5efe Support full-reset for selendroid
Replay commit ad9c73a3c4
2014-01-16 16:49:33 +00:00
rockbot
686a16ae83 adds check for API level; stops test if device is 'android' but API < 17
separates checkApiLevel functionality and cleans up little bits

cleans up the last bits
2013-12-17 15:33:53 -08:00
Jonathan Lipps
e207483a25 allow alternative type of clear through fastClear: false cap
fix #1514
2013-11-21 13:33:13 -08:00
Jonathan Lipps
165014c7ba object orientify these methods 2013-11-14 18:20:17 -08:00
eComRobotics Team
93c313303f Bugfixes for desired_capabilities updating and for ios_logging 2013-11-05 20:30:37 +04:00
Payman Delshad
2502ffdd0d (Android) Don't uninstall the app when --no-reset is used. 2013-11-01 09:25:38 +01:00
Jonathan Lipps
8e965db971 make sure we don't shut uiautomator down if it's already gone (fix #1402) 2013-10-31 15:15:30 -07:00
Jonathan Lipps
9a402b0ea7 when we get an error starting up an android test, make sure we kill uiautomator
so it doesn't complain next time we run a test
2013-10-28 11:39:50 -07:00
Jonathan Lipps
805c55d464 command timeouts should be handled centrally by appium, not by each device 2013-10-28 11:39:50 -07:00
Jonathan Lipps
32d153b6ab finish making shutdown() callback-based 2013-10-28 11:39:50 -07:00
Jonathan Lipps
386de406f3 check in midway through android startup/shutdown refactor 2013-10-28 11:39:50 -07:00
Payman Delshad
85f0b3aa73 (Android) Don't uninstall the app on fast reset. 2013-10-24 14:58:09 +02:00
Jonathan Lipps
d2a362118a fix a bunch of refactoring issues 2013-10-22 11:29:19 -07:00
Jonathan Lipps
9f129c2172 convert selendroid 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
3785fe5ca9 just use javascript's new operator rather than adding levels of abstraction 2013-10-22 11:29:19 -07:00
Jonathan Lipps
c3db317842 fix logcat issue where it returns too many logs 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
44c64db8e2 extract uiautomator behavior into its own object/library 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