Skip to content

version 1.0.0 #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ selenium-appium is [selenium-webdriver](https://seleniumhq.github.io/selenium/do
[![Monthly Downloads](https://img.shields.io/npm/dm/selenium-appium.svg)](https://npmjs.org/package/selenium-appium)
[![Build Status](https://dev.azure.com/ReactNativeWindows/selenium-appium/_apis/build/status/PR?branchName=master)](https://dev.azure.com/ReactNativeWindows/selenium-appium/_build/latest?definitionId=3&branchName=master)

## Break changes
1. selenium-appium@1.0.0 The default URL is changed from `http://localhost:4723/wd/hub` to `http://localhost:4723`. The goal is to remove appium from the project and use [winappdriver](https://www.npmjs.com/package/winappdriver) to launch and stop WinAppDriver

### Features
1. A bridge to make selenium-webdriver to drive appium for native app automation. Implement [Mobile JSON Wire Protocol Specification](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md) locator which selenium-webdriver doesn't support.
2. Supports PageObject Pattern for selenium-webdriver
Expand Down Expand Up @@ -209,29 +212,32 @@ selenium-appium projected is created when I prototype automation for react-nativ

Although [WebDriverIO](https://webdriver.io/) provides webdriver for Appium, it has some restrictions:
1. Selenium has very large user base in browser automation, but [WebDriverIO API](https://webdriver.io/docs/api.html) is different from [selenium javascript API](https://seleniumhq.github.io/selenium/docs/api/javascript/)
2. WebDriverIO has problem to support WinAppDriver, for example, https://github.com/webdriverio/webdriverio/pull/4369

2. [Already fixed] WebDriverIO has problem to support WinAppDriver, for example, https://github.com/webdriverio/webdriverio/pull/4369

Unfortunately selenium-webdriver doesn't support [
Mobile JSON Wire Protocol Specification](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md). And that's why selenium-appium project is created.


## Note
To know more about how to integrate JavaScript test runner and WinAppDriver for UI automation, please refer to:
- [WinAppDriver + WebDriverIO example](https://github.com/licanhua/wdio-winappdriver-example). Example to demostrate WinAppDriver and WebDriver integration without appium dependency

- [E2E test](https://github.com/microsoft/react-native-windows/blob/master/vnext/docs/E2ETest.md) on React Native for Windows. [MoreAboutE2ETest.md](https://github.com/microsoft/react-native-windows/blob/master/vnext/docs/MoreAboutE2ETest.md) provides some background why React Native Windows choose WinAppDriver and node test runner for E2E testing.

- [winappdriver-js-webdriver-example](https://github.com/react-native-windows/winappdriver-js-webdriver-example), Which includes:
1. Jest + selenium-webdriver + WinAppDriver
2. Jasmine + WebDriverIO + WinAppDriver
2. Jasmine + WebDriverIO + WinAppDriver. This part is obselete, please refer to [WinAppDriver + WebDriverIO example](https://github.com/licanhua/wdio-winappdriver-example) for newer change.

- [selenium-webdriver-winappdriver-example](https://github.com/react-native-windows/selenium-webdriver-winappdriver-example).
An example of jest, selenium-webdriver and winappdriver integration

- [selenium-appium](https://github.com/react-native-windows/selenium-appium). selenium-appium is selenium-webdriver extension to make selenium-webdriver to drive Appium to run automation for native, hybrid and mobile web and desktop apps.

- [Choose the right E2E automation framework for React Native Windows](https://medium.com/@licanhua/choose-the-right-e2e-automation-framework-for-react-native-windows-83ade8b16b52)

- [How to: Use Jest + selenium-webdriver + WinAppDriver to do Windows UI testing](https://medium.com/@licanhua/how-to-use-jest-selenium-webdriver-winappdriver-to-do-windows-ui-testing-c9d074e698ed)

- [Automated Windows UI testing by Jest + selenium-appium + selenium-webdriver + WinAppDriver](https://medium.com/@licanhua/automated-windows-ui-testing-by-jest-selenium-appium-selenium-webdriver-winappdriver-6cb708121d71)

- [Inspecting UI Elements for WinAppDriver automation using Appium Desktop](https://medium.com/@licanhua/inspecting-ui-elements-for-winappdriver-automation-using-appium-desktop-8f178b2d0d6c)

## License
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ steps:
- task: Windows Application Driver@0
inputs:
OperationType: 'Start'
WADArguments: 127.0.0.1 4723/wd/hub
WADArguments: 127.0.0.1 4723
AgentResolution: 1080p

- task: CmdLine@2
Expand Down
13 changes: 5 additions & 8 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
## Example to do Calulator automation on Windows
1. Download and install WinAppDriver: https://github.com/microsoft/WinAppDriver/releases/download/v1.1/WindowsApplicationDriver.msi
1. Download and install WinAppDriver: https://github.com/microsoft/WinAppDriver/releases
2. cd to example directory and install packages.

`yarn install` or `npm install`

3. start appium
3. start winappdriver or ywinappdriver

`yarn run appium` or `npm run appium`
`npx winappdriver` or `npx ywinappdriver`

expect output
```
[Appium] Welcome to Appium v1.14.1
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
```
[WinAppDriver](https://github.com/microsoft/WinAppDriver) is supported by Microsoft.
[YWinAppDriver](https://github.com/licanhua/YWinAppDriver) is an open source project which implemented WinAppDriver's functionality, and is developed by Canhua Li

4. run jest test

Expand Down
2 changes: 1 addition & 1 deletion example/__tests__/By2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { capabilities } from '../Setup'

jest.setTimeout(50000);

const url = 'http://localhost:4723/wd/hub'
const url = 'http://localhost:4723'

describe('By2', () => {
test("By2 used in selenium-webdriver.WebDriver", async () => {
Expand Down
2 changes: 1 addition & 1 deletion example/__tests__/Driver2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { capabilities } from '../Setup';

jest.setTimeout(50000);

const url = 'http://localhost:4723/wd/hub'
const url = 'http://localhost:4723'

describe('driver', () => {
test("simple webdriver2, and driver create from WebDriver", async () => {
Expand Down
Loading