463 Commits
Author SHA1 Message Date
Isaac Murchie 2933fe45ec 2.21.0 v2.21.0 2018-02-01 08:38:13 -05:00
Mykola Mokhnach c8d1a1f7da Add an endpoint for application activation (#181) 2018-01-31 14:47:40 +01:00
Isaac Murchie 074697f061 More readable caps in docs 2018-01-30 07:22:20 -05:00
dan@saucelabs.com 1a6b05e6c1 2.20.3 v2.20.3 2018-01-29 12:54:02 -08:00
Dan Graham dc662f5181 Update protocol documentation (#180) 2018-01-29 12:44:23 -08:00
Dan Graham 97c02c8af0 Rename 'mjsonwp' to 'protocol' (#178)
* Rename 'mjsonwp' to 'protocol'
  * Renamed folder from 'mjsonwp' to 'protocol' in `lib/` and `test/`
  * Renamed 'mjsonwp.js' to 'protocol.js'
  * Renamed any import statements that use 'mjsonwp'
  * _Possible breaking change_: MJSONWireProtocol class exposed in index was renamed to just Protocol.... checked Appium repo and found no libraries that use MJSONWireProtocol
* Lint fix
2018-01-29 12:41:14 -08:00
Dan Graham 85c0085292 Renamed MJSONWPError to ProtocolError (#177)
* Changed the logger to be 'W3C' when it's W3C protocol and 'MJSONWP' when it's MJSONWP protocol
2018-01-29 11:34:33 -08:00
Mykola Mokhnach 240961ecdd Tune application management endpoints (#179)
* Tune endpoints for applications management

* Add options param to terminateApp
2018-01-29 14:44:08 +01:00
dan@saucelabs.com 2681b4d990 2.20.2 v2.20.2 2018-01-25 10:51:38 -08:00
Dan Graham b2a7c5e73f Add W3C Error Response (#176)
* Fixed HTTPResponseBody for W3C error
  * Refactored `getResponseForW3CError` into errors.js file
  * Changed method so that it returns `{value: {stack: '...', message: '...', error: '...'}}`
    * Message is the same as the JSONWP error message
    * Error is a static message indicating the type of error
    * 'stack' is the callstack provided in the error
  * Added W3C 'error' messages to all of the errors
* Make 'getResponseForW3CError' handle BadParametersError
* Refactor 'getResponseForJsonwpError' to errors.js
2018-01-25 10:50:50 -08:00
Dan Graham 129dd86976 Rename ELEMENT key to W3C format (#175)
* If server encounters a response that has the wrong key name (ELEMENT when it should be 'element-6066-11e4-a52e-4f735466cecf'), rename all instances of that key
* Added a helper method (with tests) that recursively finds instances of a 'key' and renames it
* Added e2e test that mocks `findElements`, calls `/elements` endpoint and verifies that the payload was correctly renamed
2018-01-19 11:43:24 -08:00
Dan Graham 9ac3bdd634 Consolidate non-prefixed caps warnings (#174)
* Previously, it was going through alwaysMatch and all of the firstMatch caps and individually logging when any of them had unprefixed, non-standard caps
* Now it does them all at once
  * Made a helper function that takes a caps object ({alwaysMatch, firstMatch}) and finds all of the non-prefixed caps in all of them
  * Calls that function and logs warning
2018-01-18 12:50:57 -08:00
Isaac A. Murchie fff1edfe3b Get rid of arrow functions in mocha aparatus (#173) 2018-01-18 07:27:05 -05:00
Mykola Mokhnach 5308c4a47e Assume a file is located on SMB server if the path starts with double backslash (#172)
* Assume a file is located on SMB server if the path starts with double backslash

* Add more logging

* Update the test
2018-01-18 07:27:54 +01:00
dan@saucelabs.com ccee5f59b9 2.20.1 v2.20.1 2018-01-16 08:59:13 -08:00
Dan Graham a9650d7c19 Fix broken Proxy logic for W3C (#170)
* Moved 'ProxyRequestError' handling outside of the MJSONWP block.
  * When it's a proxy error, Appium translates the error (based on statusCode) to it's proper Error
  * W3C weren't doing this when ProxyRequestError was being used
  * Now W3C translates proxy errors
* Added tests in `mjsonwp-e2e-specs` that test JWProxy
  * Test successful 200 proxies
  * Tested unsuccessful responses to see that a JSONWP response with status = 6 would return the correct 'NoSuchDriverError' with statusCode = 404
2018-01-16 08:43:00 -08:00
Dan Graham 98251e0b4f Check that W3C capabilities is a plain object (#171)
* If 'capabilities' and 'desiredCapabilities' were provided, and 'capabilities' is NOT a plain object, fall back to 'desiredCapabilities'
* Added more logging to the W3C vs. MJSONWP determination logic
* Rename `createSession` args to be more descriptive
* Added basic W3C unit tests for above fix
2018-01-15 14:49:36 -08:00
dan@saucelabs.com b165d60f9e 2.20.0 v2.20.0 2018-01-12 15:18:54 -08:00
Isaac A. Murchie 7d3ba252e2 Stop making package-lock.json file (#169) 2018-01-12 13:00:24 -05:00
Mykola Mokhnach 9229a58ea4 Update parameters list for start_recording_screen/stop_recording_screen endpoints (#168) 2018-01-12 16:41:04 +01:00
Dan Graham 6902a9fc0a Fix problems with W3C responses (#166)
* Make malformed caps return 400 error
  * Add InvalidArgumentTypeError to errors
  * Made 'NotYetImplementedError' the 405 (Method Not Allowed) status code
  * Made errors in 'createSession' return InvalidArgumentTypeError
* Fix incorrect W3C responses
  * Add w3c status for NotImplemted and NotYetImplemented
  * Changed `getResponseForW3CStatusError` so that throws an unknown error if the exception isn't a w3c exception
  * Checks for property `w3cStatus` to confirm if it's a proper protocol-blessed exception
* Moved logic that reassigned errors into MJSONWP blocks; W3C shouldn't reassign errors because they all have proper status codes
* Added endpoint tests that check that you can create sessions in W3C and that subsequent calls to the session return the correct responses
2018-01-11 16:47:46 -08:00
Kazuaki Matsuo 31f16ac92f Fix implicit wait for w3c (#164)
* fix timeouts for w3c

* revert lock file

* add validation for previous timeouts

* implement custom validator for W3C

* improve if condition

* define isW3CProtocol

* rewrite validation a bit

* apply util.hasValue and string protocol

* add tests

* refactor timeouts for mjsonwp and w3c

* use const

* remove previous timeouts

* use undefined

* rename to timeouts again

* wrap some commands

* remove ...args

* define each command
2018-01-12 08:55:38 +09:00
Dan Graham 45e31b15ac Set automations in one file (#167)
* Made an 'automations.js' file that lists all valid automations as an Object instead of hard-coding it
* appium/appium will use this instead of hardcoding automation names
* Make desired-caps pull in the values of those automations for validation instead of hard-coding them
* Expose 'validAutomations' to Driver object
2018-01-11 10:07:33 -08:00
Dan Graham 281916ffee W3C remediations (#165)
* Fixed a defect in 'firstMatch' validation
  * Previously, it was validating the firstMatch capabilities and was failing on the first validation failure, which is a problem if firstMatch has a length > 1 and it fails before finding a potentially passing capabilities set is found
  * Now, it doesn't error-out on the first failure. If it fails, it skips over it to the next one until it finds one that passes and returns that.

* Altered the 'presence' constraint validation
  *  Don't validate 'presence' on 'alwaysMatch' because if a capability isn't present on 'alwaysMatch' it may be present in one of the 'firstMatch' capabilities
  *  Validate presence on all of the 'firstMatch' capabilities, except for the keys that are present in 'alwaysMatch'. If the key is in 'alwaysMatch', strip out the presence constraint because we know that it has passed already

* Changed the default protocol
  * If MJSONWP _and_ W3C are provided, initiate a W3C session by default. If clients are passing in W3C parameters to create a session, we can safely assume that they've implemented the rest of the W3C spec

* Improved error logging
  * If errors were found, show a message saying `Could not find matching capabilities: ${errors}` where `errors` are a list of all the validation error messages for each of the attempts to validate `firstMatch` caps
  * If `firstMatch` caps has a length of one, then don't show the message saying `Could not find matching capabilities` portion of it, just show the errors

* Other remediations
  * Allow `alwaysMatch` and `firstMatch` to be `null` or `undefined`
  * Added single quotes around names of capabilities when showing their errors
2018-01-10 10:37:11 -08:00
Kazuaki Matsuo 1bc64380c5 add getting active element for w3c (#163) 2018-01-04 20:13:27 +09:00
Isaac Murchie 81c28d8962 2.19.0 v2.19.0 2018-01-02 08:42:33 -05:00
Mykola Mokhnach 9f95a75d96 Make sure that temporary files are cleaned up properly while configuring the app (#158)
* Make sure that temporary files are cleaned up properly while configuring the app

* Improve the algorithm for files downloaded from SMB shares
2017-12-29 20:03:47 +01:00
Dan Graham 1a8730138d Check shouldValidate before validating (#162) 2017-12-23 16:19:38 -08:00
dan@saucelabs.com 3a576ed354 2.18.4 v2.18.4 2017-12-22 13:34:37 -08:00
dan@saucelabs.com a3c1c75f3d Fix: w3c response missing 'capabilities' 2017-12-22 13:34:00 -08:00
dan@saucelabs.com e758ac13c9 2.18.3 v2.18.3 2017-12-22 13:21:41 -08:00
Dan Graham b7a99abc91 w3c CreateSession response (#161) 2017-12-22 13:20:52 -08:00
Dan Graham 376a0d3089 Make it so that 'status' is only returned for MJSONWP (#160)
Also:
* Make the 'fake-driver' a MJSONWP driver
* Fix unit tests that were broken when being called in 'appium-fake-driver'
2017-12-22 12:20:48 -08:00
dan@saucelabs.com 6101dc0fae 2.18.2 v2.18.2 2017-12-21 10:00:27 -08:00
Dan Graham d41b3629aa Don't validate 'presence' on firstMatch caps (#159)
* Doesn't make sense to validate 'presence' in the firstMatch caps, because the firstMatch caps extend alwaysMatch
* Only 'alwaysMatch' should validate 'presence'
2017-12-21 09:55:27 -08:00
dan@saucelabs.com ff254e122d 2.18.1 v2.18.1 2017-12-20 15:15:03 -08:00
Dan Graham ab1c359bad Fix incorrect identifying of unprefixed caps (#157) 2017-12-20 15:14:13 -08:00
Isaac Murchie 619fc4bfb9 2.18.0 v2.18.0 2017-12-19 09:02:27 -05:00
Isaac A. Murchie 973a6d70bb Add printPageSourceOnFindFailure flag to print source when find fails (#156) 2017-12-19 09:01:34 -05:00
Isaac Murchie 9b6d4b041b 2.17.2 v2.17.2 2017-12-18 07:33:05 -05:00
Jørgensen 8a705f8978 Added info about valid settings (#155) 2017-12-18 07:32:23 -05:00
Isaac Murchie 23ddc3068b 2.17.1 v2.17.1 2017-12-15 16:07:47 -05:00
Mykola Mokhnach 1a91bec967 Support pre-W3C element screenshot endpoint (#154) 2017-12-15 16:03:06 -05:00
dan@saucelabs.com c6a4e49843 2.17.0 v2.17.0 2017-12-13 14:53:50 -08:00
Dan Graham 53de387100 Handle capabilities prefixes (#153)
* Strip out 'appium:' prefixes
* Reject standard capabilities that contain the 'appium:' prefix
* Expose 'processCapabilities' as API method
2017-12-13 14:53:05 -08:00
dan@saucelabs.com ea62f58d6c 2.16.0 v2.16.0 2017-11-21 13:57:52 +01:00
Dan Graham 090d94795a Add W3C /actions endpoint (#146) 2017-11-21 04:54:39 -08:00
Dan Graham 4d2a5bd000 w3c routes (#147)
* Add aliased W3C routes
* Implement getTimeouts command
* getTimeouts returns an object containing all the timeouts and their values as key-value pairings
* Added routeHandler too
* Added w3c routes
2017-11-21 04:54:39 -08:00
Dan Graham 308e560ca1 W3C Error Formatting (#145)
* Remember protocol requested in createSession
  * Also renamed 'processCaps' to 'processCapabilities'
  * Checks the parameters in 'createSession' and determines if it's W3C or MJSONWP
* Add W3C error format
  * Add W3C status codes to errors
  * When deciding error format to return in mjsonwp.js, check format and then return eitherJSONWP or W3C format
2017-11-21 04:54:39 -08:00
Isaac Murchie 50fc067b7e 2.15.9 v2.15.9 2017-11-17 10:01:57 -05:00