Commit Graph

81 Commits

Author SHA1 Message Date
Dylan Lacey
21c8feb8e5 Add new device and automation capabilities, deprecate old caps
Added deprecation warning for older style caps.  Warnings are output
once only for a given function or capability.  A final trailing log
message is released saying there were deprecations.

Busted unit tests into smaller tests

Capabilities are now an object, created by passing the capabilities
to Capabilities.  Properties on that object are copied into the Capabilities object so the API is identical.

Store the value of platformVersion as version.
2014-03-19 09:35:36 -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
ec46e59c28 Merge pull request #2048 from bootstraponline/ios_mercy
Default to mercy on iOS
2014-03-12 10:01:39 -07:00
bootstraponline
19b8fc4b10 Default to mercy on iOS 2014-03-12 12:50:58 -04:00
sebv
6bfb2729a5 Making sure cwd is appium install dir 2014-03-12 10:56:31 +08:00
Jonathan Lipps
50d03d6b08 store --command-timeout as int 2014-03-07 14:30:00 -08: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
Jonathan Lipps
77c20b05d5 show extra server params in logs for easier debugging 2014-03-07 10:41:06 -08:00
Payman Delshad
113fe5ce10 Added support for touch{Down|Up|Move} on Android. 2014-03-07 15:10:52 +01:00
Jonathan Lipps
42780f2655 port chrome config 2014-03-03 16:40:16 -08:00
Jonathan Lipps
b058732ebb port android basic config 2014-03-03 16:40:16 -08:00
Jonathan Lipps
d097c94c90 Merge pull request #1973 from pavelsmolensky/keepKeyChains
Add option --keep-keychains to save Library/Keychains between appium session restarts
2014-03-03 13:37:08 -08:00
Pavel Smolensky
f30631d784 iOS. Add --keep-keychains option and desired capability keepKeyChains 2014-03-03 18:01:13 +03: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
37f9081b6c Merge pull request #1956 from Jonahss/master
bugfix: watchForUnresponsiveInstruments process run on systems without ios configured
2014-02-26 09:28:09 -08: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
jonahss
8d6864a55a bugfix: watchForUnresponsiveIntruments process was being run even on systems which did not have ios configured, causing a fatal error. 2014-02-25 15:54:11 -08:00
jonahss
cd411874a4 changed .appiumconfig to .apapiumconfig.json so we can load it with require() and have it cached 2014-02-25 15:53:55 -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
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
midopa
7324ff0f40 Auto config node host and port for Selenium Grid 2014-02-07 12:18:37 -08:00
Jonathan Lipps
ccfbd07603 bring back git rev into appium output 2014-02-06 12:11:12 -08:00
Isaac Murchie
6daff9e810 Add app wait package 2014-02-04 15:35:58 -08: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
bootstraponline
e556a71b6c Fix iOS reset
iOS reset deletes the following:

/iPhone Simulator/7.0.3/Library/TCC
/iPhone Simulator/7.0.3/Library/Caches
/iPhone Simulator/7.0.3/Media
/iPhone Simulator/7.0.3/Library/Keychains
/iPhone Simulator/7.0.3/Applications

iOS full reset deletes the entire 'iPhone Simulator' folder.
2014-02-01 12:02:03 -05:00
Isaac Murchie
5d7a543839 Handle errors in spawn 2014-01-30 11:43:23 -08:00
sebv
968576af3d jshinting with white=true 2014-01-30 16:58:19 +08:00
sebv
714e24c789 Test reformatting, step2. 2014-01-30 16:55:47 +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
b67440ad0b if we have trouble proxying, best to actually error to the client 2014-01-08 10:02:27 -08:00
Dan Cuellar
82d49d0c7d Adding flag to show simulator logs 2014-01-07 14:09:18 -08:00
Jonathan Lipps
27d482074c Merge pull request #1679 from bootstraponline/shell
Fix appium shell
2014-01-03 01:14:46 -08:00
bootstraponline
f603af0684 Fix appium shell
node appium.js --shell
2013-12-26 21:09:30 -05:00
Jonathan Lipps
31bd697cf4 add ability to set launch timeout from the command line so it can be used in conjunction with pre-launch 2013-12-20 10:57:42 -08: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
Jonathan Lipps
e08970b75d Merge pull request #1657 from jlipps/safari7
Safari on iOS 7
2013-12-19 13:36:21 -08:00
Jonathan Lipps
eefb31edfc Merge pull request #1634 from grz0/master
Catch SyntaxError exception and log nice error message
2013-12-18 15:56:27 -08:00
Jonathan Lipps
c9b6f55739 Merge pull request #1645 from rockbot/master
politely informs user that mobile commands don't work in selenium
2013-12-18 15:56:02 -08:00
grz0
f23748c29d Catch SyntaxError exception and log nice error message 2013-12-19 00:01:50 +01:00
Jonathan Lipps
a4f82c31cd remove safari launcher as strategy for safari + sim 2013-12-18 14:03:30 -08:00
Jonathan Lipps
4a1cc2580c refactor instruments and add appium-internal flake support
This commit constitutes a pretty big refactor of the instruments
process handler. It also introduces a server flag, '--backend-retries',
with a default of '3', which specifies how many times Appium will retry
launching instruments before giving up and saying that it crashed or
timed out. This works in concert with launchTimeout, of course.

I think this refactor also fixes some longstanding callback reasoning
errors and maybe some other bugs.

It might also introduce some bugs of its own though :-)
2013-12-18 13:34:49 -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
24e899bdca make sure show-config works with npm (fix #1630) 2013-12-17 11:10:48 -08:00