Skip to content

Commit da30402

Browse files
Merge pull request #22 from webdriverio/feat/add-appium-service
Feat/add appium service
2 parents 051ae7a + 22d3aa1 commit da30402

13 files changed

+6511
-583
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ npm-debug.log
1414
# custom
1515
apps/
1616
*.log
17+
chromeDriver

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ Boilerplate project to run Appium tests together with WebdriverIO for:
2020

2121
## Based on
2222
This boilerplate is currently based on:
23-
- **WebdriverIO:** `4.13.#`
24-
- **Appium:** `1.9.0`
23+
- **WebdriverIO:** `5.7.#`
24+
- **Appium:** `1.12.0`
2525

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

2827
## Installing Appium on a local machine
2928
See [Installing Appium on a local machine](./docs/APPIUM.md)
@@ -48,6 +47,8 @@ Choose one of the following options:
4847
This boilerplate uses a specific config for iOS and Android, see [configs](./config/) and are based on `wdio.shared.conf.js`.
4948
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).
5049

50+
> **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
51+
5152
## Locator strategy for native apps
5253
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).
5354
`accessibilityID`'s make it easy to script once and run on iOS and Android because most of the apps already have some `accessibilityID`'s.

config/saucelabs/wdio.android.rdc.app.conf.js

+3
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ config.region = 'eu';
4848
// and uncomment the below line of code
4949
// config.region = 'us';
5050

51+
// This port was defined in the `wdio.shared.conf.js`
52+
delete config.port;
53+
5154
exports.config = config;

config/saucelabs/wdio.ios.rdc.app.conf.js

+3
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ config.region = 'eu';
4747
// and uncomment the below line of code
4848
// config.region = 'us';
4949

50+
// This port was defined in the `wdio.shared.conf.js`
51+
delete config.port;
52+
5053
exports.config = config;

config/wdio.android.app.conf.js

-6
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,4 @@ config.capabilities = [
3030
},
3131
];
3232

33-
// ====================
34-
// Appium Configuration
35-
// ====================
36-
// Default port for Appium
37-
config.port = 4723;
38-
3933
exports.config = config;

config/wdio.android.browser.conf.js

-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,4 @@ config.capabilities = [
2929
},
3030
];
3131

32-
// ====================
33-
// Appium Configuration
34-
// ====================
35-
// Default port for Appium
36-
config.port = 4723;
37-
3832
exports.config = config;

config/wdio.ios.app.conf.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ config.capabilities = [
1818
// The defaults you need to have in your config
1919
deviceName: 'iPhone X',
2020
platformName: 'iOS',
21-
platformVersion: '12.1',
21+
platformVersion: '12.2',
2222
orientation: 'PORTRAIT',
2323
maxInstances: 1,
2424
// The path to the app
@@ -30,10 +30,4 @@ config.capabilities = [
3030
},
3131
];
3232

33-
// ====================
34-
// Appium Configuration
35-
// ====================
36-
// Default port for Appium
37-
config.port = 4723;
38-
3933
exports.config = config;

config/wdio.ios.browser.conf.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ config.capabilities = [
2323
browserName: 'safari',
2424
newCommandTimeout: 240,
2525
},
26-
];
27-
28-
// ====================
29-
// Appium Configuration
30-
// ====================
31-
// Default port for Appium
32-
config.port = 4723;
26+
]
3327

3428
exports.config = config;

config/wdio.shared.conf.js

+15
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ exports.config = {
2020
connectionRetryCount: 3,
2121
reporters: [ 'spec' ],
2222

23+
// ====================
24+
// Appium Configuration
25+
// ====================
26+
services: [ 'appium' ],
27+
appium: {
28+
// For options see
29+
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
30+
args: {
31+
// For arguments see
32+
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
33+
},
34+
},
35+
36+
port: 4723,
37+
2338
// ====================
2439
// Some hooks
2540
// ====================

docs/FAQ.md

+11
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@ Failed: An unknown server-side error occurred while processing the command. Orig
99
```
1010
1111
The solution is to:
12+
- use an older version of ChromeDriver
1213
- manually upgrade chrome on your emulator/device
1314
- pick a newer emulator/device
1415
16+
### Use an older version of ChromeDriver
17+
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.
18+
Then provide the path to the downloaded ChromeDriver by adding the following to your command:
19+
20+
```shell
21+
$ npm run android.app -- --appium.args.chromedriverExecutable="./chromeDriver/chromedriver"
22+
```
23+
24+
The `appium.args.chromedriverExecutable` needs to refer to the location where the ChromeDriver is downloaded.
25+
1526
### Manually update chrome
1627
Execute the following steps to install Chrome on an Android emulator
1728

0 commit comments

Comments
 (0)