Commit Graph

57 Commits

Author SHA1 Message Date
Jonathan Lipps
1cae9c593c fix #2567 2014-05-14 12:25:29 +01:00
Ruben Gonzalez Alonso
858b4a30e9 Add optional argument 'language' to getStrings in Android and Selendroid 2014-05-13 09:58:05 +02:00
Isaac Murchie
19d6b77f0e Fix defaults for swipe duration 2014-05-06 15:38:49 -07:00
Isaac Murchie
320162cd05 Shift milliseconds to seconds in swipe 2014-05-02 18:02:34 -07:00
Jonathan Lipps
8a5b698e28 bring grunt lint into parity with jshintrc, and fix lint issues 2014-05-01 12:09:17 -07:00
Isaac Murchie
c77d01db6d Allow for different inputs to find 2014-04-16 14:29:48 -07:00
Jonathan Lipps
6d8411ba65 the appium element/value command needs to use setValueImmediate 2014-04-15 15:00:05 -07:00
Jonathan Lipps
c293cfe2f2 update our testsuite to use new native methods
instead of deprecated mobile methods.
Also add a few server methods that were accidentally
left out before
2014-04-14 16:50:52 -07:00
Jonathan Lipps
caa5463dba remove 'mobile: ' interface for appium commands
leave the gesture commands for now incase we need the clients to fall
back to them pending full working through the touchaction/multiaction
api
2014-04-14 15:07:23 -07:00
Isaac Murchie
e0b1cadd00 Decode swipe action to native method 2014-04-14 11:04:48 -07:00
Jonathan Lipps
50c3dbd7fd remove 'mobile: findAndAct' 2014-04-10 14:09:57 -07:00
Isaac Murchie
8e89c749ef Fix bugs in action handling 2014-04-10 10:59:50 -07:00
Sergio Neves Barros
8292b71387 Updated the app argument for the installApp, launchApp and closeApp to point to the device rather than appium. Also added a check for the "installToRealDevice" function to check if "launch" desired capability has not been set to false (as in that instance we want to manage installation and launching ourselves).
Changed the launch parameter to autoLaunch (including a check for launch desired capability and deprecation warning).
2014-04-10 10:00:01 -07:00
Jonathan Lipps
b78c8ddfe9 remove 'mobile: getCommandTimeout' 2014-04-09 18:45:25 -07:00
Jonathan Lipps
0312620d09 remove 'mobile: localScreenshot' 2014-04-09 18:43:02 -07:00
Jonathan Lipps
f1ab0c7a73 remove 'mobile: findElementNameContains' 2014-04-09 18:41:02 -07:00
Jonathan Lipps
2871411d90 remove 'mobile: waitForPageLoad' 2014-04-09 18:40:03 -07:00
Jonathan Lipps
afe4674f4a remove 'mobile: fireEvent' 2014-04-09 18:38:23 -07:00
Jonathan Lipps
b0fdf70de2 get rid of 'mobile: location' 2014-04-09 18:36:07 -07:00
Jonathan Lipps
e2c6a9919b remove json page source in favor of xml
and fix a bug in android bootstrap's xpath that snuck in last time
2014-04-09 18:07:02 -07:00
Jonathan Lipps
37b3d8b6e4 fix selendroid command timeout bug and fix test that proves it work 2014-04-09 13:34:00 -07:00
Jonathan Lipps
6725332707 don't use windowHandles for switching to/from webview 2014-04-08 12:02:44 -07:00
Isaac Murchie
0df0d2b2dc Add touch and multitouch actions for Android 2014-04-07 12:13:16 -07:00
Jonathan Lipps
0b2bd7b276 Merge pull request #2246 from jlipps/new-endpoints
deprecate soon-to-be-removed mobile: methods
2014-04-02 13:33:54 -07:00
Jonathan Lipps
28f966e9a1 deprecate soon-to-be-removed mobile: methods 2014-04-02 13:32:22 -07:00
Jonathan Lipps
477c7f14dd Merge pull request #2245 from jlipps/new-endpoints
add rest endpoints to handle mobile: methods
2014-04-02 12:48:38 -07:00
Jonathan Lipps
bf4dcae4f1 add rest endpoints to handle mobile: methods in addition to executeScript 2014-04-02 12:15:34 -07:00
Isaac Murchie
016b8c6559 First pass at iOS touch for Appium 1.0 2014-03-31 14:00:44 -07:00
Linzhen Xuan
148e5f3ba3 Modify scroll to take element argument.
Originally, scroll scrolls insider the first ScrollView. However, most of our ScrollViews is CollectionView, or TableView. So, we got error that the ScrollView could not found, although there are multiple "ScrollViews".

We also need to able to scroll insider different scrollviews.
2014-03-28 17:47:55 -04:00
dolf
28c5fd51c3 Move reset timeout from global before to session before 2014-03-27 15:38:04 +04:00
Dylan Lacey
0cbdb9b2d4 Log a deprecation message when mobileSource is called with the JSON
type, asking users to use XML type instead.
2014-03-25 03:18:46 -07:00
Isaac Murchie
f4f730e1ee Use contexts for switching native/web 2014-03-19 21:13:47 -07:00
Jonathan Lipps
f14c5c9108 use adb's built-in isAppInstalled rather than one that doesn't work 2014-03-17 15:10:58 -07:00
bootstraponline
6494df98d6 Android mobile push & pull
Ruby examples:

mobile :pushFile, data: Base64.encode64('test ruby'), path: '/data/local/tmp/test.txt'

pull_result = mobile :pullFile, path: '/data/local/tmp/test.txt'
Base64.decode64 pull_result
2014-03-14 15:09:13 -04:00
Jonathan Lipps
e7a72e5921 add --command-timeout server arg
so the server can set its own default timeout.
also, clean up some of the command timeout logic
2014-03-07 13:57:41 -08:00
Payman Delshad
113fe5ce10 Added support for touch{Down|Up|Move} on Android. 2014-03-07 15:10:52 +01:00
bootstraponline
cce7ee0126 Android longClick x, y, and duration support
Ruby examples:

mobile :longClick, element: el.ref

mobile :longClick, element: el.ref, duration: 3000

mobile :longClick, x: 400, y: 297, duration: 3000

mobile :longClick, x: 0.5, y: 0.244
2014-02-27 16:18:05 -05:00
Jonathan Lipps
410aacc1e6 Merge pull request #1961 from paymand/scrollTo
Android: Added support for 'direction' to scrollTo.
2014-02-26 09:27:38 -08:00
Payman Delshad
b0976fece8 Android: Added support for 'direction' to scrollTo.
This fix adds a new option (direction) to 'mobile: scrollTo'.
If 'horizontal' is provided (or if the view is a HorizontalScrollView),
we will call setAsHorizontalList() before commencing the scroll.
2014-02-26 15:44:39 +01:00
Jonathan Lipps
077e6996b4 show stacktrace when we can't start a session 2014-02-20 16:17:23 -08:00
bootstraponline
bbd03f89c6 Add androidCoverage 2014-02-14 12:54:05 -05:00
Jonathan Lipps
d2af7968d7 add ability to scroll ios views
this works on ios7!
2014-02-13 17:38:22 -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
Jonathan Lipps
42bd48bc36 actually, selendroid does need to support a few mobile methods as it turns out! cc @rockbot 2013-12-19 15:43:48 -08:00
rockbot
91caf798f7 politely informs user that mobile commands don't work in selenium
adds extra test to ensure it's the mobile: error message that's getting sent
2013-12-18 11:43:29 -08:00
Jonathan Lipps
7b770c8411 add lots more tests for command timeout
testing setting via desired caps as well
also, make it so passing in 'false' also disables timeout
2013-12-10 11:46:07 -08:00
Matt Isaacs
d0a1968fd0 Setting newCommandTimeout capability to 0 disables timeout. 2013-12-10 12:31:27 -05:00
Jonathan Lipps
99f0c16d9a make sure we don't discount web locators in webviews 2013-12-04 12:24:31 -08:00