-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from 2gis/winium-origins
Rename solution to Winium. Major code cleanup
- Loading branch information
Showing
125 changed files
with
1,440 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,71 @@ | ||
Windows Universal App Driver | ||
============================ | ||
# Winium for Store Apps | ||
[![Inner Server NuGet downloads](https://img.shields.io/nuget/dt/Winium.StoreApps.InnerServer.svg?style=flat-square)](https://www.nuget.org/packages/Winium.StoreApps.InnerServer/) | ||
[![Inner Server NuGet version](https://img.shields.io/nuget/v/Winium.StoreApps.InnerServer.svg?style=flat-square)](https://www.nuget.org/packages/Winium.StoreApps.InnerServer/) | ||
|
||
Selenium Driver for automated testing of Windows Universal applications. | ||
Winium.StoreApps is an open source, test automation tool for Windows Store apps, tested on emulators (currently only testing of Windows Phone apps is supported). | ||
|
||
This repository hosts the code for the Windows Phone driver. You can use it for testing of native Windows Phone 8.1 applications. Currently it implements only limited subset of [WebDriver JSON Wire Protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol) and supports testing only via an emulator (Windows Phone 8.1). | ||
## Supported Platforms | ||
- Windows Phone 8.1 | ||
|
||
Driver consists of two parts: the Driver (selenium based) and InnerServer (for application). To run tests you will need to add `WindowsUniversalAppDriver.InnerServer` to the app you want to test and start `WindowsUniversalAppDriver` (Remote WebDriver to send Json Wire Protocol commands to). | ||
For Windows Phone 8 Silverlight test automation tool see [Windows Phone Driver](https://github.com/2gis/winphonedriver). | ||
For Windows Desktop (WPF, WinForms) test automation tool see [Winium Desktop](https://github.com/2gis/cruciatus). | ||
|
||
Requirements to run tests using Windows Phone driver | ||
--------------------------------------------------- | ||
## Why Winium? | ||
As said by appium: | ||
> - You can write tests with your favorite dev tools using any WebDriver-compatible language such as Java, Objective-C, JavaScript with Node.js (in promise, callback or generator flavors), PHP, Python, Ruby, C#, Clojure, or Perl with the Selenium WebDriver API and language-specific client libraries. | ||
> - You can use any testing framework. | ||
## Requirements | ||
* Windows 8 or higher | ||
* Visual Studio 2013 with Update 2 or higher | ||
* Windows phone 8.1 SDK | ||
* You will also need Visual Studio 2013 with Update 2 or higher to build driver. | ||
|
||
Usage | ||
----- | ||
1. Build solution | ||
2. In tested app project, add reference to `WindowsUniversalAppDriver.InnerServer` (from https://www.nuget.org/packages/WindowsUniversalAppDriver.InnerServer) | ||
3. In your app’s source code locate place where `RootFrame` is set (usually in `PrepareApplication` if you use `Caliburn.Micro` or App.xaml.cs for vanilla app) and add | ||
|
||
```cs | ||
AutomationServer.Instance.InitializeAndStart(RootFrame); | ||
``` | ||
|
||
or (will include driver only for debug build) | ||
|
||
```cs | ||
#if DEBUG | ||
AutomationServer.Instance.InitializeAndStart(RootFrame); | ||
#endif // DEBUG | ||
``` | ||
|
||
where `RootFrame` is visual root of application. | ||
|
||
4. Write your tests using you favorite language. In your test use `app` desired capability to set path to tested app's appx file (python example). | ||
```python | ||
... | ||
self.driver = webdriver.Remote( | ||
command_executor = 'http://localhost:9999', | ||
desired_capabilities={ | ||
"app": r"C:\testApp.appx" | ||
}) | ||
... | ||
# find all Textblock elements | ||
blocks= self.driver.find_elements_by_tag_name("System.Windows.Controls.TextBlock") | ||
``` | ||
5. Start WindowsUniversalAppDriver.exe | ||
6. Run your tests | ||
|
||
You can get Visual Studio and SDK form Microsoft [here](https://dev.windows.com/en-us/develop/download-phone-sdk). | ||
|
||
## Quick Start | ||
**App under test (AUT)** is application that you would like to test. | ||
|
||
1. Add reference to `Winium.StoreApps.InnerServer` in AUT project ([install NuGet package](https://www.nuget.org/packages/Winium.StoreApps.InnerServer/) or build project yourself) | ||
|
||
2. In your AUT's source code locate place where `Frame` is set (usually in `MainPageOnLoaded` for vanilla app or `PrepareApplication` if you use `Caliburn.Micro`) add | ||
|
||
```cs | ||
AutomationServer.Instance.InitializeAndStart(Frame); | ||
``` | ||
|
||
or (will include driver only for debug build) | ||
|
||
```cs | ||
#if DEBUG | ||
AutomationServer.Instance.InitializeAndStart(Frame); | ||
#endif // DEBUG | ||
``` | ||
|
||
where `Frame` is visual root of application. | ||
|
||
3. Write your tests using you favorite language. In your tests use `app` [desired capability](https://github.com/2gis/Winium.StoreApps/wiki/Capabilities) to set path to tested app's appx file. Here is python example: | ||
```python | ||
# put it in setUp | ||
self.driver = webdriver.Remote(command_executor='http://localhost:9999', | ||
desired_capabilities={'app': 'C:\\testApp.appx'}) | ||
# ut it in test method body | ||
element = self.driver.find_element_by_id('SetButton') | ||
element.click() | ||
assert 'CARAMBA' == self.driver.find_element_by_id('MyTextBox').text | ||
``` | ||
|
||
4. Start `Winium.StoreApps.Driver.exe` ([download release from github](https://github.com/2gis/Winium.StoreApps/releases) or build it yourself) | ||
|
||
5. Run your tests and watch the magic happening | ||
|
||
## Writing tests | ||
Essentially, Winium.StoreApps supports limited subset of [WebDriver JSON Wire Protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol), which means that you can write tests just like you would write for Selenium or Appium, here are some [docs](http://docs.seleniumhq.org/docs/03_webdriver.jsp). | ||
For test samples look at [our functional tests](https://github.com/2gis/Winium.StoreApps/tree/master/Winium/TestApp.Test/py-functional). | ||
|
||
|
||
## How it works | ||
Winium.StoreApps consists of two essential parts: | ||
|
||
1. **Winium.StoreApps.Driver** implements Selenium Remote WebDriver and listens for JsonWireProtocol commands. It is responsible for launching emulator, deploying AUT, simulating input, forwarding commands to `Winium.StoreApps.InnerServer`, etc. | ||
|
||
2. **Winium.StoreApps.InnerServer** (the one that should be embedded into AUT) communicates with `Winium.StoreApps.Driver.exe` and executes different commands, like finding elements, getting or setting text values, properties, etc., inside your application. |
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
WindowsUniversalAppDriver/TestApp.Test/py-functional/README.md
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
WindowsUniversalAppDriver/TestApp.Test/py-functional/run_tests.bat
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
...Driver/WindowsUniversalAppDriver.InnerServer/WindowsUniversalAppDriver.InnerServer.nuspec
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
REM delete existing nuget packages | ||
del *.nupkg | ||
set NUGET=.\.nuget\nuget.exe | ||
%NUGET% pack .\Winium.StoreApps.InnerServer\Winium.StoreApps.InnerServer.csproj -IncludeReferencedProjects -Prop Configuration=Release | ||
%NUGET% push *.nupkg |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Functional tests for Windows Universal App Driver | ||
Functional tests for Windows Universal App Driver written in python. | ||
|
||
## Usage | ||
|
||
1. Build Windows Universal App Driver solution. | ||
2. Make store package from TestApp. | ||
3. Run tests `run_tests.bat` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
REM Run Winium.StoreApps.Driver.exe | ||
start ..\..\Winium.StoreApps.Driver\bin\Debug\Winium.StoreApps.Driver.exe | ||
|
||
REM Run tests | ||
pip install -r requirements.txt | ||
py.test tests --tb=native -s | ||
|
||
taskkill /im Winium.StoreApps.Driver.exe /f |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ndowsUniversalAppDriver.Common/Command.cs → Winium/Winium.StoreApps.Common/Command.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace WindowsUniversalAppDriver.Common | ||
namespace Winium.StoreApps.Common | ||
{ | ||
#region | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...sUniversalAppDriver.Common/CommandInfo.cs → ...um/Winium.StoreApps.Common/CommandInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace WindowsUniversalAppDriver.Common | ||
namespace Winium.StoreApps.Common | ||
{ | ||
public class CommandInfo | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...niversalAppDriver.Common/DriverCommand.cs → .../Winium.StoreApps.Common/DriverCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
....Common/Exceptions/AutomationException.cs → ....Common/Exceptions/AutomationException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace WindowsUniversalAppDriver.Common.Exceptions | ||
namespace Winium.StoreApps.Common.Exceptions | ||
{ | ||
#region | ||
|
||
|
6 changes: 5 additions & 1 deletion
6
...Exceptions/InnerDriverRequestException.cs → ...Exceptions/InnerDriverRequestException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...versalAppDriver.Common/JsonWireClasses.cs → ...inium.StoreApps.Common/JsonWireClasses.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
...pDriver.Common/Properties/AssemblyInfo.cs → ...oreApps.Common/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
using System.Resources; | ||
#region | ||
|
||
using System.Reflection; | ||
using System.Resources; | ||
|
||
#endregion | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("WindowsUniversalAppDriver.Common")] | ||
[assembly: AssemblyTitle("Winium.StoreApps.Common")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("WindowsUniversalAppDriver.Common")] | ||
[assembly: AssemblyProduct("Winium.StoreApps.Common")] | ||
[assembly: AssemblyCopyright("Copyright © 2015")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
[assembly: NeutralResourcesLanguage("en")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("0.1.*")] | ||
[assembly: AssemblyVersion("1.0.*")] |
Oops, something went wrong.