Skip to content

Commit

Permalink
Merge pull request #13 from NetlifeBackupSolutions/use_version_1.6.2
Browse files Browse the repository at this point in the history
Use version 1.6.2
  • Loading branch information
ole-vegard committed Jun 6, 2016
2 parents 308a476 + a944377 commit ae709d6
Show file tree
Hide file tree
Showing 105 changed files with 3,572 additions and 1,015 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

<!--## Unreleased-->

## v1.6.2
- Fix `PageSource` failing to serialize nested classes


## v1.6.1
- Fix `GetElementAttribute` not returning some Dependency Properties.


## v1.6.0
- Addd path expansion for files capability to make it easier to deploy folders to app's local storage #128
- Add setting to limit access to Automation, Dependency or CLR properties for `GetElementAttribute` command #120
- Add setting to serialize `Enums` by name, not value for `GetElementAttribute` command #120
- Change the way Automation Properties names are handled by `GetElementAttribute` command #123


## v1.5.0
- Fix crash on bad JSON request body
- Fix not reading http request body to end in certain cases
- Increase default ping timeout
- Add `--ping-timeout` option and `pingTimeout` desired capability to set ping timeout
- Add `noFallback` desired capability to prevent driver from trying to connect to `9998` port
- Add support for deployment of UWP apps (Windows 10 apps)
- Fix error when `debugConnectToRunningApp` is set to `true`
- Add support for accessing `AutomationProperties` with `GetElementAttribute` command


## v1.4.0
- Fix `Remote Procedure Call Failed` when trying to launch app under test by retrying it
- Fix `sessionId` being `null` in response for some commands (thanks to [@tkurnosova](https://github.com/tkurnosova))
- Add support for deployment of dependenecies (thanks to [@ole-vegard](https://github.com/ole-vegard))
- Add `IsElementEnabled` command
- Fix socket interrupt handling
- Add Selenium Grid support and autoregistering Winium as Selenium Grid node ([Running tests in parallel](https://github.com/2gis/Winium.StoreApps/wiki/Running-tests-in-parallel))
- Fix sessionId not being unique
- Add `--bound-device-name` command line option
- Use indented formatting for JSON responses for pretty logging
- Fix logger timestamp format (thanks to [@magnarn](https://github.com/magnarn))


## v1.3.1
- Fix click command for custom controls

Expand Down
1 change: 1 addition & 0 deletions PrepareRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Function Test()
$runTestsPath = Join-Path $solutionDir 'TestApp.Test\py-functional'

$env:RELEASE=1
$env:REMOTE_RUN=1
$proc = Start-Process "$runTestsPath/run_tests.bat" -PassThru -Wait -WorkingDirectory $runTestsPath
Write-Host $proc.ExitCode

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Winium.StoreApps is an open source test automation tool for Windows Store apps,

## Supported Platforms
- Windows Phone 8.1
- Windows 10 Mobile

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).
Expand All @@ -34,7 +35,7 @@ You have Selenium WebDriver for testing of web apps, Appium for testing of iOS a
## Requirements
* Windows 8 or higher
* Visual Studio 2013 with Update 2 or higher
* Windows phone 8.1 SDK
* Windows phone 8.1 SDK and/or Windows 10 SDK

You can get Visual Studio and SDK from Microsoft [here](https://dev.windows.com/en-us/develop/download-phone-sdk).

Expand All @@ -56,9 +57,9 @@ You can get Visual Studio and SDK from Microsoft [here](https://dev.windows.com/
AutomationServer.Instance.InitializeAndStart();
#endif // DEBUG
```
3. Assure that `Internet (Client & Server)` capability is enabled in package manifest of your AUT. It should be enabled by default for Windows 8.1 apps. In UWP (Windows Mobile 10) it is disabled by default (only `Internet (Client)` is enabled).


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:
4. 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',
Expand All @@ -70,9 +71,9 @@ You can get Visual Studio and SDK from Microsoft [here](https://dev.windows.com/
```
> Make sure to set `deviceName` capability to `Emulator` if you are using the driver on a system where Visula Studio 2015 or Winodws 10 SDK is installed.

4. Start `Winium.StoreApps.Driver.exe` ([download release from github](https://github.com/2gis/Winium.StoreApps/releases) or build it yourself)
5. 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
6. 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).
Expand Down
11 changes: 7 additions & 4 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Winium.StoreApps это open-source инструмент для автомати

## Поддерживаемые платформы
- Windows Phone 8.1
- Windows 10 Mobile

Для автоматизации Windows Phone 8 Silverlight есть [Windows Phone Driver](https://github.com/2gis/winphonedriver).
Для автоматизации Windows Desktop (WPF, WinForms) есть [Winium Desktop](https://github.com/2gis/Winium.Desktop).
Expand All @@ -29,7 +30,7 @@ Winium.StoreApps это open-source инструмент для автомати
## Требования
* Windows 8 или выше
* Visual Studio 2013 (Update 2 или выше)
* Windows phone 8.1 SDK
* Windows phone 8.1 SDK и/или Windows 10 SDK

Вы можете взять Visual Studio и SDK с сайта Microsoft [здесь](https://dev.windows.com/en-us/develop/download-phone-sdk).

Expand All @@ -50,7 +51,9 @@ Winium.StoreApps это open-source инструмент для автомати
#endif // DEBUG
```

3. Пишите тесты на удобном языке. В тесте используйте `app` [desired capability](https://github.com/2gis/Winium.StoreApps/wiki/Capabilities) для задания пакета (appx) приложения. Это пример на python:
3. Убедитесь, что в манифесте пакета вашего тестируемого приложения включено разрешение для возможности `Internet (Client & Server)`. Эта возможность должна быть разрешена по умолчанию для Windows 8.1 приложений. Для UWP (Windows Mobile 10) приложений эта возможность отключена по умолчанию (включена только `Internet (Client)`).

4. Пишите тесты на удобном языке. В тесте используйте `app` [desired capability](https://github.com/2gis/Winium.StoreApps/wiki/Capabilities) для задания пакета (appx) приложения. Это пример на python:
```python
# put it in setUp
self.driver = webdriver.Remote(command_executor='http://localhost:9999',
Expand All @@ -61,9 +64,9 @@ Winium.StoreApps это open-source инструмент для автомати
assert 'CARAMBA' == self.driver.find_element_by_id('MyTextBox').text
```

4. Запустите `Winium.StoreApps.Driver.exe` ([загрузить последнюю версию с github](https://github.com/2gis/Winium.StoreApps/releases) или соберите проект у себя)
5. Запустите `Winium.StoreApps.Driver.exe` ([загрузить последнюю версию с github](https://github.com/2gis/Winium.StoreApps/releases) или соберите проект у себя)

5. Запустите тесты и балдейте от происходящей магии
6. Запустите тесты и балдейте от происходящей магии

## Написание тестов
По сути, Winium.StoreApps поддерживает ограниченное подмножество команд из [WebDriver JSON Wire Protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol), т.е. вы можете писать ваши тесты также, как если бы вы писали их под Selenium или Appium, см. например [документацию Selenium](http://docs.seleniumhq.org/docs/03_webdriver.jsp).
Expand Down
98 changes: 98 additions & 0 deletions Winium/Microsoft.Phone.Tools.Deploy.Patched/DependencyFinder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Patched version of DependencyFinder for Windows 10 UWP manifest support
// Type: Microsoft.Phone.Tools.Deploy.DependencyFinder
// Assembly: Microsoft.Phone.Tools.Deploy, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 86EA135B-1DD4-4D0E-BB40-E685CB8C02D7
// Assembly location: C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\Microsoft.Phone.Tools.Deploy.dll
namespace Microsoft.Phone.Tools.Deploy.Patched
{
#region

using System;
using System.IO;
using System.Linq;

using Microsoft.Phone.Tools.Common;

#endregion

public class DependencyFinder
{
#region Public Methods and Operators

public static string[] GetAppDependencyPackages(string packageFilePath)
{
var info = Utils.ReadAppManifestInfoFromPackage(packageFilePath);

return
info.AppDependencies.Select(depend => GetAppDependencyPackageFileName(packageFilePath, depend, info))
.Where(dependencyPackageFileName => !string.IsNullOrEmpty(dependencyPackageFileName))
.ToArray();
}

#endregion

#region Methods

private static bool DoesPackageFileMatchDependencyRequirement(string fileNameToCheck, AppDependency depend)
{
// NOTE: Uses patched Utils
var appManifestInfo = Utils.ReadAppManifestInfoFromPackage(fileNameToCheck);
if (StringComparer.InvariantCultureIgnoreCase.Equals(appManifestInfo.Name, depend.Name))
{
return appManifestInfo.AppVersion >= depend.MinVersion;
}

return false;
}

private static string FindMatchinDependencyRequirementInDirectory(
string packageFileName,
string directory,
AppDependency depend)
{
if (!Directory.Exists(directory))
{
return null;
}

foreach (var str in Directory.GetFiles(directory, "*.appx", SearchOption.AllDirectories))
{
if (!StringComparer.InvariantCultureIgnoreCase.Equals(packageFileName, str)
&& DoesPackageFileMatchDependencyRequirement(str, depend))
{
return str;
}
}

return null;
}

private static string GetAppDependencyPackageFileName(
string packageFileName,
AppDependency depend,
IAppManifestInfo info)
{
var path1 = Path.Combine(Path.GetDirectoryName(packageFileName), "Dependencies");
var str = Path.Combine(path1, info.ProcessorArchitecture);
var strArray = new[]
{
Path.GetDirectoryName(packageFileName), str, path1, Constants.WindowsPhoneApp81SDKRoot
};
foreach (var directory in strArray)
{
var requirementInDirectory = FindMatchinDependencyRequirementInDirectory(
packageFileName,
directory,
depend);
if (!string.IsNullOrEmpty(requirementInDirectory))
{
return requirementInDirectory;
}
}

return null;
}

#endregion
}
}
36 changes: 36 additions & 0 deletions Winium/Microsoft.Phone.Tools.Deploy.Patched/DeviceInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Type: Microsoft.Phone.Tools.Deploy.DeviceInfo
// Assembly: Microsoft.Phone.Tools.Deploy, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 86EA135B-1DD4-4D0E-BB40-E685CB8C02D7
// Assembly location: C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\Microsoft.Phone.Tools.Deploy.dll
namespace Microsoft.Phone.Tools.Deploy.Patched
{
public class DeviceInfo
{
#region Constructors and Destructors

internal DeviceInfo(string deviceid, string deviceName)
{
this.DeviceId = deviceid;
this.DeviceName = deviceName;
}

#endregion

#region Properties

internal string DeviceId { get; private set; }

internal string DeviceName { get; private set; }

#endregion

#region Public Methods and Operators

public override string ToString()
{
return this.DeviceName;
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{13B4DF5C-E542-4A7A-8F00-929D423B522C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Phone.Tools.Deploy.Patched</RootNamespace>
<AssemblyName>Microsoft.Phone.Tools.Deploy.Patched</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Phone.Tools.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86" />
<Reference Include="Microsoft.Phone.Tools.Deploy">
<HintPath>C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\Microsoft.Phone.Tools.Deploy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SmartDevice.Connectivity.Interface, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.SmartDevice.MultiTargeting.Connectivity, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DependencyFinder.cs" />
<Compile Include="DeviceInfo.cs" />
<Compile Include="Package10.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading

0 comments on commit ae709d6

Please sign in to comment.