Skip to content

Commit 8bef980

Browse files
committed
update Readme
1 parent 2f99f6b commit 8bef980

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ selenium-appium is [selenium-webdriver](https://seleniumhq.github.io/selenium/do
1616
npm i selenium-appium --save-dev
1717
```
1818

19-
### By2
19+
### [By2 example](https://github.com/react-native-windows/selenium-appium/blob/master/example/__tests__/By2.test.ts)
2020
- By2 is a subclass of selenium-webdriver.By. So you can use it anywhere which selenium-webdriver provides.
2121
- Also By2 implements the WebElement interface, so you can call click and other element operation directly.
2222
- No webdriver.wait needed. Instead of findElement, By2 itself loop until element is located before actual click happens.
@@ -46,7 +46,7 @@ npm i selenium-appium --save-dev
4646
});
4747
```
4848

49-
### driver
49+
### [driver example](https://github.com/react-native-windows/selenium-appium/blob/master/example/__tests__/Driver2.test.ts)
5050
- driver is a wrapper of WebDriver which selenium-webdriver provides.
5151
- Implements all functions of WebDriver of selenium-webdriver.
5252
- It provides the default driver for By2.
@@ -82,7 +82,7 @@ startWithWebDriver allows you to attach the driver to existing WebDriver if capa
8282
});
8383
```
8484

85-
###
85+
### [PageObject example](https://github.com/react-native-windows/selenium-appium/blob/master/example/__tests__/CalculatorWithPageObject.test.ts)
8686
[PageObject](https://github.com/SeleniumHQ/selenium/wiki/PageObjects) reduces the amount of duplicated code and easy to maintain.
8787
1. get in typescript would make you always get new instance of By2. For example, get resultTextBox()
8888
2. waitForPageLoaded pairs with isPageLoaded. You only need to overload isPageLoaded. waitForPageLoaded would poll until isPageLoaded is true or timeout.
@@ -178,7 +178,7 @@ use the PageObject
178178
});
179179
```
180180

181-
### Configuration
181+
### [Configuration example](https://github.com/react-native-windows/selenium-appium/blob/master/example/__tests__/Times.ts)
182182
There are two global timers: waitforPageTimeout and waitforTimeout.
183183

184184
waitforTimeout is used by By2. When call any WebElement function of By2, it loops until the element is located

example/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Example to do Calulator automation on Windows
2+
1. cd to example directory and install packages.
3+
4+
`yarn install` or `npm install`
5+
6+
2. start appium
7+
8+
`yarn run appium` or `npm run appium`
9+
10+
expect output
11+
```
12+
[Appium] Welcome to Appium v1.14.1
13+
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
14+
```
15+
16+
3. run jest test
17+
18+
`yarn run jest` or `npm run jest`

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"@types/selenium-webdriver": "^4.0.1",
1919
"babel-jest": "^24.8.0",
2020
"jest": "^24.8.0",
21-
"selenium-appium": "^0.0.10",
21+
"selenium-appium": "^0.0.11",
2222
"selenium-webdriver": "^4.0.0-alpha.4",
2323
"typescript": "^3.5.3",
24-
"appium":"1.14.2"
24+
"appium": "1.14.2"
2525
}
2626
}

0 commit comments

Comments
 (0)