Skip to content

Instantly share code, notes, and snippets.

@dpgraham
Created January 9, 2018 21:20
Show Gist options
  • Save dpgraham/22419a6894ae784c472b5c1926f0ed97 to your computer and use it in GitHub Desktop.
Save dpgraham/22419a6894ae784c472b5c1926f0ed97 to your computer and use it in GitHub Desktop.
* Appium 1.8.0 will be the first version of Appium to _fully_ implement [W3C](https://github.com/jlipps/simple-wd-spec)
* 1.7.2 accepts W3C parameters during session creation but coerces them into a MJSONWP session
* The [W3C](https://github.com/jlipps/simple-wd-spec) simplified spec doc that JLipps wrote explains most of how the spec works
* This document will elaborate on how Appium implements this spec
## Session Creation
* When parameters are passed to the session creation endpoint (`POST /session`), Appium will parse the body and determine if it should start a W3C or MJSONWP Session
* If the body contains an object called `capabilities` it will be a W3C session
* Else if the body contains an object called `desiredCapabilities` it will be an MJSONWP session
* If both are provided, it will be a W3C session (NOTE: If anyone objects to this and feels that it should be MJSONWP, please let me know)
* If w3c capabilities are provided, it will parse the caps as explained in the spec (https://github.com/jlipps/simple-wd-spec#processing-capabilities)
* Format of W3C capabilities object
* Expected format is same as spec
```javascript
{
capabilities: {
alwaysMatch: {...},
firstMatch: [{...}, ...}]
}
}
```
* Including MJSONWP and W3C is fine
```javascript
{
desiredCapabilities: {...}
capabilities: {
alwaysMatch: {...},
firstMatch: [{...}, ...}]
}
}
```
*
### Session Creation Examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment