Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
- update docs
  • Loading branch information
wswebcreation committed Apr 11, 2019
1 parent 16bac3a commit 22d3aa1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 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
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
17 changes: 9 additions & 8 deletions tests/specs/app.webview.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ describe('WebdriverIO and Appium, when interacting with a WebView,', () => {
toggle.waitForDisplayed(3000);
toggle.click();

const call = $('=call');
call.waitForDisplayed(3000);
call.click();
const webdriverProtocol = $('=Webdriver Protocol');
webdriverProtocol.waitForDisplayed(3000);
webdriverProtocol.click();

const header = $('h1.postHeaderTitle');
header.waitForDisplayed(3000);
expect(header.getText()).toEqual('CALL');
expect(header.getText()).toEqual('WEBDRIVER PROTOCOL');

/**
* IMPORTANT!!
Expand Down Expand Up @@ -68,12 +68,13 @@ describe('WebdriverIO and Appium, when interacting with a WebView,', () => {
WebViewScreen.switchToContext(CONTEXT_REF.WEBVIEW);
// And open the `call` action
toggle.click();
const call = $('=call');
call.waitForDisplayed(3000);
call.click();

const webdriverProtocol = $('=Webdriver Protocol');
webdriverProtocol.waitForDisplayed(3000);
webdriverProtocol.click();

const header = $('h1.postHeaderTitle');
header.waitForDisplayed(3000);
expect(header.getText()).toEqual('CALL');
expect(header.getText()).toEqual('WEBDRIVER PROTOCOL');
});
});

0 comments on commit 22d3aa1

Please sign in to comment.