Commit Graph

1356 Commits

Author SHA1 Message Date
Dan Graham 050db9880a Fall back to MJSONWP if W3C is invalid (#10034)
* If processCapabilities throws error, then log a warning that it was invalid and log the message and fall back to using jsonwpCaps
2018-01-18 18:07:56 -08:00
Dan Graham ee569cbed1 Use MJSONWP if dcaps have extraneous params (#10019)
* Update `parseCapsForInnerDriver` so that now if it finds extraneous keys in `jsonwpCaps`, fall back to using MJSONWP instead of W3C
* After getting processed caps, check the protocol again because if `processedW3CCapabilities` was set to null, it should be JWP
* Removed tests that tested for capabilities being merged together (those are no longer needed)
* Added tests (unit test and e2e test) that check that creation of a new session will fall back to JSONWP when there are extraneous keys
2018-01-18 13:02:09 -08:00
Dan Graham fb7280da32 No hardcoded automation names (#10002) 2018-01-17 07:48:30 -05:00
Dan Graham f27d6565d0 W3C Full Implementation (#9972)
* Refactored code from createSession into parseCapsForInnerDriver()
  * parseCapsForInnerDriver() takes jsonwp and w3c capabilities and translates them into objects that can be accepted by the "inner driver" that it proxies to
  * It adds defaultCapabilities to capabilities.firstMatch and jsonwp caps
  * It finds matching caps for W3C and then creates a new W3C capabilities object that only has the valid matching one
  * After parseCapsForInnerDriver() parses the JSONWP and W3C it passes the results along to the inner-driver and it's up to the inner driver to create a W3C or JSONWP session

* Add validation to W3C session creation
  * Call to 'processCapabilities' does validation now so that it will match an object that passes Appium's validation rules (e.g.: platformName, deviceName required; automation name must be valid, etc...)
  * Test that it accepts combo of W3C and JSONWP capabilities
  * Test that it rejects invalid W3C capabilities with 400 error
  * Also added 'createSession' unit test
  * Stripped out unnecessary async/await from driver-specs

* Insert Appium prefixes into W3C caps
  * Previously, Appium just took the W3C capabilities, processed them into a caps object and 
  passed them into the inner driver as

  ```
  {
    alwaysMatch: parsedCaps,
    firstMatch: [{}],
  }
  ```

  * The problem with this is that all of the parsedCaps were unprefixed, and therefore the Inner 
  Driver complained about it

  * Now, it takes the parsedCaps and calls a new method called 'insertAppiumPrefixes' on the 
  parsed caps like this:

  ```
  {
    alwaysMatch: {...insertAppiumPrefixes(parsedCaps)},
    firstMatch: [{}],
  }
  ```

  * Refactored tests that were affected by this change
  * Added tests to test insertAppiumPrefixes function
2018-01-16 10:26:44 -08:00
Dan Graham b666c3353c Force MJSONWP protocol (#9869)
* The 'executeCommand' on appium-base-driver checks the protocol by looking for the w3c 'capabilities' object
* Right now it's finding it and then appium is merging capabilities into desiredCapabilities so we're getting a case of 'createSession' misidentified as W3C
* Fix for next release is just to monkey-patch the method that determines the protocol to return MJSONWP
2018-01-02 09:40:28 -05:00
Dan Graham f62a2a2875 Merge W3C caps into JSONWP desiredCapabilities (#9824) 2017-12-20 15:13:49 -08:00
Dan Graham a8911ba51c Support w3c createSession (#9791)
* In 'createSession', process w3c caps using 'processCapabilities' method exposed by base-driver
* Add tests that run W3C requests on server to verify that it's accepting w3c format
2017-12-15 09:24:28 -08:00
Mykola Mokhnach b8199b8472 Remove redundant variable 2017-12-14 14:26:02 +01:00
Mykola Mokhnach af8fed6186 tune logging 2017-12-14 14:24:36 +01:00
Mykola Mokhnach 1e47e1b0a9 Address review comments 2017-12-14 14:22:19 +01:00
Mykola Mokhnach dca6708fe6 Add relaxed security command line flag 2017-12-13 20:49:45 +01:00
Isaac Murchie 3d7dd1e857 Fix logging of caps 2017-11-06 09:21:59 -05:00
Wei Gu 433a453903 Fix synchrous issue: appium may call session check even after session is deleted (#9550) 2017-10-30 14:42:26 -04:00
Isaac A. Murchie 94635edeac Update linting (#9123)
* Update linting

* Move minimum node version to 5

* Remove coverage for now

* Fix docs for node version

* Fail for node 4 and below
2017-08-31 07:49:43 -04:00
Mykola Mokhnach 89242a40bc Cancel commands queueing for the umbrella driver (#9052) 2017-08-22 09:45:24 -04:00
Mykola Mokhnach 64ccbc1a98 Add basic synchonization to session creation and deletion (#8983)
* Guard sessions and pending drivers lists

* Address review comments

* Improve session deletion

* Perform fast return if the session is not present in the sessions list
2017-08-21 14:16:12 -04:00
Mykola Mokhnach 83d0cc3468 Include the information about pending drivers being currently at creation stage into createSession argument (#8925)
* Include the information about pending drivers being currently at creation stage into createSession argument

* Address review comments
2017-07-31 17:16:05 -04:00
Mykola Mokhnach 48e411bfe2 Pass the list of running sessions to deleteSession (#8907)
* Pass the list of running sessions to deleteSession

* Tune the logic for getting other sessions data

* update unit test

* Skip unused argument
2017-07-31 17:14:56 -04:00
Yatin Phatak e8d59cda59 getStatus command from grid should not be queued (#8819) 2017-07-12 07:42:03 -04:00
Dan Graham 09622aea33 Espresso Driver added to appium (#8640) 2017-06-09 11:03:00 -07:00
Dan Graham 0b3441fdff Remove date-utils library and use node-dateformat (#8328)
* Removed date-utils and removed require
* Replaced call to date.toFormat(...) with dateformat(date, '...')
2017-04-26 13:03:31 -04:00
Mykola Mokhnach c04c8e4758 Add --enable-heapdump feature (#8176)
* Add possibility to take snapshots of node process memory heap

* Move heapdump to optional dependencies
2017-04-18 12:06:39 -04:00
Dan Cuellar 9af79b2b81 Add MacDriver (#8046)
* Add MacDriver

* Add MacDriver to version map

* Add some notes about Mac

* Update README.md

* Add section about mac apps.

* Move information to running on OS X page
2017-03-16 16:27:19 -07:00
Isaac Murchie 90d62dd7dd Move to logger from appium-support 2017-02-28 15:09:49 -05:00
Isaac Murchie 0142e5a917 Fix formatting of default capabilities 2017-02-14 11:19:49 -05:00
Dan Graham 6f5a9d1001 Don't allow undefined process.argv[1] in parser
argParse breaks if process.argv[1], which is a problem if Appium is being run as a binary. Added check so that if process.argv[1] is undefined, set the prog name to 'Appium'
2017-02-10 11:38:41 -08:00
Isaac Murchie cea2448c55 Add version string to driver announcement 2017-01-27 12:46:47 -05:00
Isaac Murchie 9503b3d03d Once catch signals once 2017-01-05 08:04:29 -05:00
Jonathan Lipps 3db81cc19a refactor unexpected shutdown, and fix lint so we can use upgraded appium eslint 2016-12-07 14:39:03 -08:00
Isaac A. Murchie 02edea9d29 Merge pull request #7015 from KrugerHeavyIndustries/graceful_exit
graceful handling of SIGTERM and SIGINT such that return codes are mo…
2016-10-28 14:46:57 +02:00
Rubén González Alonso 069a33c5eb Fix grid register with Selenium 3 hubs 2016-10-25 18:16:12 +02:00
Rubén González Alonso ea93f0b1d3 Allow to connect an Appium node to Selenium Grid 3 2016-10-20 17:21:28 +02:00
Chris Kruger f43247e38b graceful handling of SIGTERM and SIGINT such that return codes are more in line Unix process exit codes 2016-10-19 17:30:53 +08:00
Alex Lau 95819c29ab Fix --suppress-adb-kill-server command line argument 2016-10-17 14:13:38 -07:00
Isaac A. Murchie 9362fb224b Merge pull request #6920 from sravanmedarapu/master
Added UiAutomator2 Driver
2016-10-01 16:48:31 -04:00
Sravan Medrapu 8813cbdf1d Added UiAutomator2 Driver 2016-10-01 23:50:47 +05:30
Omuro 513c39b852 Add server parameter for WebDriverAgent local port 2016-09-27 16:37:33 -07:00
Ali Kia b127b80cc2 add reboot option for android emulator 2016-09-09 13:34:21 +08:00
Jonathan Lipps 52f990a2f4 don't do an implicit string+int comparison 2016-08-18 16:28:18 -07:00
Jonathan Lipps fb4a9c0be0 make XCUITest driver the default for ios tests with platformVersion >= 10 2016-08-18 14:59:31 -07:00
Sam Park 1482423198 Remove default ChromeDriver port in arg parse
If null and required, Android driver will pick a random available one
2016-08-18 09:40:33 -07:00
Isaac A. Murchie 0c14015659 Merge pull request #6664 from jlipps/master
add WinAppDriver beta under the Windows platform
2016-08-08 12:08:15 -07:00
Isaac Murchie 7403a13c1a Require Node 4+ 2016-08-03 12:37:20 -07:00
Isaac A. Murchie d3ee825371 Merge pull request #6715 from appium/isaac-eslint
Add eslint and pre-commit hooks
2016-08-03 12:35:47 -07:00
Isaac Murchie 50725af059 Add eslint and pre-commit hooks 2016-08-03 12:14:29 -07:00
Tomasz Wojtuń 4ae1b28ff5 Fix handling of grid node id 2016-08-03 17:09:42 +02:00
Jonathan Lipps 02b9fcb30c add option for calling library to have appium throw instead of process.exit 2016-07-19 21:51:05 -07:00
Jonathan Lipps 6413d55b4f add 'dest' key to some parser options since we rely on this key and it was undefined in places 2016-07-19 15:03:05 -07:00
Jonathan Lipps c22c00fb82 add ability for importing package to send in logHandler which can spy on logs
this is necessary for the new appium desktop
2016-07-19 15:03:05 -07:00
Jonathan Lipps 56bea2e511 ensure we don't include args in deprecated/non-default list which don't actually have values 2016-07-18 23:06:12 -07:00