Automated Windows UI testing by Jest + selenium-appium + selenium-webdriver + WinAppDriver
I was working on choosing a JS friendly UI automation framework for React Native on Windows, and the first solution jumped into mind is Detox. After sometime I dropped this solution because there is no existing public ‘Gray box’ library for UWP apps just like EarlGrey for iOS. Then I fall backed to Appium+WinAppDriver solution. There are two popular WebDrivers: WebDriverIO and selenium-webdriver. Both WebDriverIO(see description in PR 4369) and selenium-webdriver(PR 7505) have problem to be integrated with WinAppDriver. Hereafter I only talk about selenium-webdriver.
WinAppDriver supports testing Universal Windows Platform (UWP), Windows Forms (WinForms), Windows Presentation Foundation (WPF), and Classic Windows (Win32) apps on Windows 10 PCs.
Selenium is a large community, and the API is familar to a lot of people. So I create selenium-appium to make selenium-webdriver capable of automation with WinAppDriver, and it provides:
- Supports mobile JSON Wire Locator from By2
- PageObject pattern and handy feature like Locator and waitForPageLoaded. Instead of using webDriver.wait first and then click, it’s been consolidated to the locator By2.click.
For calculator example of using selenium-webdriver+WinAppDriver on Windows, please refer to example
For more about this, please refer to selenium-appium project