* 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
* 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
* 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
* 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
* 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
* Doesn't make sense to validate 'presence' in the firstMatch caps, because the firstMatch caps extend alwaysMatch
* Only 'alwaysMatch' should validate 'presence'
* 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