Skip to content

Commit

Permalink
Merge pull request #22 from webdriverio/feat/add-appium-service
Browse files Browse the repository at this point in the history
Feat/add appium service
  • Loading branch information
wswebcreation authored Apr 11, 2019
2 parents 051ae7a + 22d3aa1 commit da30402
Show file tree
Hide file tree
Showing 13 changed files with 6,511 additions and 583 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ npm-debug.log
# custom
apps/
*.log
chromeDriver
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ Boilerplate project to run Appium tests together with WebdriverIO for:

## Based on
This boilerplate is currently based on:
- **WebdriverIO:** `4.13.#`
- **Appium:** `1.9.0`
- **WebdriverIO:** `5.7.#`
- **Appium:** `1.12.0`

Updates to the latest versions will come, see [TODO](./README.md#todo)

## Installing Appium on a local machine
See [Installing Appium on a local machine](./docs/APPIUM.md)
Expand All @@ -48,6 +47,8 @@ Choose one of the following options:
This boilerplate uses a specific config for iOS and Android, see [configs](./config/) and are based on `wdio.shared.conf.js`.
This shared config holds all the defaults so the iOS and Android configs only need to hold the capabilities and specs that are needed for running on iOS and or Android (app or browser).

> **NEW:** The new `@wdio/appium-service` is now also integrated in this boilerplate so you don't need to start an Appium server yourself, WebdriverIO will do that for you
## Locator strategy for native apps
The locator strategy for this boilerplate is to use `accessibilityID`'s, see also the [WebdriverIO docs](http://webdriver.io/guide/usage/selectors.html#Accessibility-ID) or this newsletter on [AppiumPro](https://appiumpro.com/editions/20).
`accessibilityID`'s make it easy to script once and run on iOS and Android because most of the apps already have some `accessibilityID`'s.
Expand Down
3 changes: 3 additions & 0 deletions config/saucelabs/wdio.android.rdc.app.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ config.region = 'eu';
// and uncomment the below line of code
// config.region = 'us';

// This port was defined in the `wdio.shared.conf.js`
delete config.port;

exports.config = config;
3 changes: 3 additions & 0 deletions config/saucelabs/wdio.ios.rdc.app.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ config.region = 'eu';
// and uncomment the below line of code
// config.region = 'us';

// This port was defined in the `wdio.shared.conf.js`
delete config.port;

exports.config = config;
6 changes: 0 additions & 6 deletions config/wdio.android.app.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,4 @@ config.capabilities = [
},
];

// ====================
// Appium Configuration
// ====================
// Default port for Appium
config.port = 4723;

exports.config = config;
6 changes: 0 additions & 6 deletions config/wdio.android.browser.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,4 @@ config.capabilities = [
},
];

// ====================
// Appium Configuration
// ====================
// Default port for Appium
config.port = 4723;

exports.config = config;
8 changes: 1 addition & 7 deletions config/wdio.ios.app.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ config.capabilities = [
// The defaults you need to have in your config
deviceName: 'iPhone X',
platformName: 'iOS',
platformVersion: '12.1',
platformVersion: '12.2',
orientation: 'PORTRAIT',
maxInstances: 1,
// The path to the app
Expand All @@ -30,10 +30,4 @@ config.capabilities = [
},
];

// ====================
// Appium Configuration
// ====================
// Default port for Appium
config.port = 4723;

exports.config = config;
8 changes: 1 addition & 7 deletions config/wdio.ios.browser.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ config.capabilities = [
browserName: 'safari',
newCommandTimeout: 240,
},
];

// ====================
// Appium Configuration
// ====================
// Default port for Appium
config.port = 4723;
]

exports.config = config;
15 changes: 15 additions & 0 deletions config/wdio.shared.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ exports.config = {
connectionRetryCount: 3,
reporters: [ 'spec' ],

// ====================
// Appium Configuration
// ====================
services: [ 'appium' ],
appium: {
// For options see
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
args: {
// For arguments see
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
},
},

port: 4723,

// ====================
// Some hooks
// ====================
Expand Down
11 changes: 11 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@ Failed: An unknown server-side error occurred while processing the command. Orig
```
The solution is to:
- use an older version of ChromeDriver
- manually upgrade chrome on your emulator/device
- pick a newer emulator/device
### Use an older version of ChromeDriver
Go to the link that is provided in the log, see [here](https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md), follow the steps and download the version you need to have.
Then provide the path to the downloaded ChromeDriver by adding the following to your command:
```shell
$ npm run android.app -- --appium.args.chromedriverExecutable="./chromeDriver/chromedriver"
```
The `appium.args.chromedriverExecutable` needs to refer to the location where the ChromeDriver is downloaded.
### Manually update chrome
Execute the following steps to install Chrome on an Android emulator
Expand Down
Loading

0 comments on commit da30402

Please sign in to comment.