* Added debug, attach to debug, test-all, and test-current-file
* The debug and attach to debug allow you to run Appium server
* Made some changes to how package.json is located to support being able to run Mocha tests directly from 'test/' instead of from 'build/test/'
* Make it so executeCommand returns protocol and value/error
* This is so that base driver can read the protocol and serve the response (base driver doesn't know what the protocol of the inner drivers are)
* Added tests to confirm that it falls back to MJSONWP if an inner driver is not ready and handles concurrent MJSONWP and W3C sessions
* Updated unit tests to match the new format
* Use uia2 backend by default if platform version is greater or equal to 6
* Allow to force set the backend to UIA1
* Add unit tests
* Tune the log message
* Print a warning message instead of changing the driver type
* Remove redundant imports
* Tune the message
* Address PR comments
* 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
* 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
* 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
* 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
* 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