Commit Graph

66 Commits

Author SHA1 Message Date
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
Jonathan Lipps 1ebc3dd655 make sure we don't start FQInstruments on non-mac or mac < 10.9 (fix #1585) 2013-12-10 13:36:43 -08:00
Jonathan Lipps abe22334b1 refactor server/main
and add --merciful flag to avoid the force quit instruments watcher
2013-12-10 13:25:58 -08:00
Jonathan Lipps 4e3caf7043 Merge pull request #1602 from bootstraponline/master
Pipe force quit logs to console
2013-12-10 12:30:18 -08:00
bootstraponline 5181bb90dd Pipe force quit logs to console
info: [ForceQuitUnresponsiveApps] 2013-12-10 15:11:16.424 ForceQuitUnresponsiveApps[56799:507] Force quit unresponsive instruments v0.0.1
info: [ForceQuitUnresponsiveApps] 2013-12-10 15:11:42.708 ForceQuitUnresponsiveApps[56799:507] Force quitting: 'freeze2' at 'file:///Users/user/ForceQuitUnresponsiveApps/freeze2/./bin/freeze2.app/Contents/MacOS/instruments'
2013-12-10 15:12:11 -05: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 6319f734b8 allow user to let instruments launch device with --default-device 2013-12-09 14:44:23 -08:00
Jonathan Lipps 0edd3a629d make sure --show-config doesn't crash main server :-) 2013-12-09 14:39:51 -08:00
Jonathan Lipps 52bb752773 add --show-config flag to show appium config, and include server build time 2013-12-09 14:13:42 -08:00
Jonathan Lipps 99f0c16d9a make sure we don't discount web locators in webviews 2013-12-04 12:24:31 -08:00
Jonathan Lipps f4477adfd1 fail sooner if user passes in a bad locator strategy (fix #1539) 2013-12-04 09:48:55 -08:00
bootstraponline eaa6cb3d18 Recover from unresponsive instruments process
Register for kCGSNotificationAppUnresponsive and if the process is Instruments then terminate it.
This enables Appium to continue even when instruments is unresponsive. The current behavior is to wait forever.

To test this feature works properly, run ./instruments.sh from https://github.com/appium/ForceQuitUnresponsiveApps

instruments.sh will launch a process that's unresponsive and appium will force quit the process. The unresponsive process can be visually confirmed by using OS X Activity Monitor.
2013-12-03 14:07:38 -05:00
Dan Cuellar 94f4e3eb69 select your iOS Simulator Device 2013-11-18 14:46:11 -08:00
Curtis Siemens 3d58646824 Adding the ability to get node path out of .appiumconfig (for users who modify .appiumconfig) 2013-11-14 17:37:00 -08:00
bootstraponline 338c54664f Merge pull request #1467 from paymand/log_no_colors
Make sure there's no color in the console output when --log-no-colors is used.
2013-11-14 13:18:48 -08:00