[Packages] Update UITest and consolidate packages (#1201)

* [Packages] Update UITest and consolidate packages

* [Controls] Remove old packages

* [UITest] Try fix UITests iOS11

* [UITests] Use back instead of custom class
This commit is contained in:
Rui Marinho 2017-10-18 18:04:03 +01:00
Родитель 8886a8f357
Коммит 5b67a1b6e8
15 изменённых файлов: 47 добавлений и 48 удалений

Просмотреть файл

@ -70,7 +70,7 @@ namespace Xamarin.Forms.Controls.Issues
// index out of bounds exceptions if the query for the frame and its Rect run quickly enough
RunningApp.WaitForElement(q => q.Marked("frame"));
AppRect frameBounds = RunningApp.Query (q => q.Marked ("frame"))[0].Rect;
RunningApp.Pan (new Drag (frameBounds, frameBounds.X + 10, frameBounds.Y + 10, frameBounds.X + 100, frameBounds.Y + 100, Drag.Direction.LeftToRight));
RunningApp.Pan (new Drag (frameBounds, frameBounds.CenterX, frameBounds.Y + 10, frameBounds.X + 100, frameBounds.Y + 100, Drag.Direction.LeftToRight));
RunningApp.WaitForElement (q => q.Marked ("Panning: Completed"));
}

Просмотреть файл

@ -3,6 +3,7 @@
using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using System.Threading.Tasks;
#if UITEST
using NUnit.Framework;
@ -17,7 +18,7 @@ namespace Xamarin.Forms.Controls.Issues
{
protected override void Init ()
{
var userNameEditor = new Entry () { Text = "userNameEditorEmptyString" };
var userNameEditor = new Entry () { AutomationId = "userNameEditorEmptyString", Text = "userNameEditorEmptyString" };
userNameEditor.Focused += (sender, args) => {
userNameEditor.Text = "focused";
};
@ -36,10 +37,12 @@ namespace Xamarin.Forms.Controls.Issues
#endif
public void TestFocusIsOnTheEndAfterSettingText ()
{
RunningApp.WaitForElement("userNameEditorEmptyString");
RunningApp.Tap (c => c.Marked ("userNameEditorEmptyString"));
RunningApp.EnterText ("1");
PressEnter ();
Assert.Greater (RunningApp.Query (c => c.Marked ("focused1")).Length, 0);
var q = RunningApp.Query(c => c.Marked("userNameEditorEmptyString"));
Assert.AreEqual("focused1", q[0].Text);
}
void PressEnter ()

Просмотреть файл

@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Linq;
@ -130,11 +129,12 @@ namespace Xamarin.Forms.Controls
try
{
var responseString = string.Empty;
using (var httpClient = new HttpClient())
{
var feed = "http://feeds.hanselman.com/ScottHanselman";
responseString = await httpClient.GetStringAsync(feed);
}
//TODO: get feed and
//using (var httpClient = new HttpClient())
//{
// var feed = "http://feeds.hanselman.com/ScottHanselman";
// responseString = await httpClient.GetStringAsync(feed);
//}
FeedItems.Clear();
var items = await ParseFeed(responseString);

Просмотреть файл

@ -342,26 +342,9 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Reference Include="PCLStorage, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
<HintPath>..\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PCLStorage.Abstractions, Version=1.0.2.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64, processorArchitecture=MSIL">
<HintPath>..\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.Abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Insights">
<HintPath>..\packages\Xamarin.Insights.1.12.3\lib\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="BeforeBuild">
<CreateItem Include="blank.config">
@ -370,4 +353,4 @@
<Copy SourceFiles="@(ConfigFile)" DestinationFiles="controlgallery.config" Condition="!Exists('controlgallery.config')" />
</Target>
<Import Project="..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets')" />
</Project>
</Project>

Просмотреть файл

@ -1,8 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="PCLStorage" version="1.0.2" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Xamarin.Insights" version="1.12.3" targetFramework="portable45-net45+win8+wp8+wpa81" />
</packages>

Просмотреть файл

@ -57,8 +57,8 @@
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Xamarin.UITest, Version=2.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.UITest.2.1.2\lib\net45\Xamarin.UITest.dll</HintPath>
<Reference Include="Xamarin.UITest, Version=2.1.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.UITest.2.1.4\lib\net45\Xamarin.UITest.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.2" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.4" targetFramework="net45" />
</packages>

Просмотреть файл

@ -16,18 +16,20 @@ namespace Xamarin.Forms.Core.UITests
public static void NavigateBack (this IApp app)
{
app.Tap (Queries.NavigationBarBackButton ());
app.Back();
}
public static void NavigateToGallery (this IApp app, string page)
{
const string goToTestButtonQuery = "* marked:'GoToTestButton'";
var text = Regex.Match (page, "'(?<text>[^']*)'").Groups["text"].Value;
app.EnterText (q => q.Raw ("* marked:'SearchBar'"), text);
app.WaitForElement(q => q.Raw(goToTestButtonQuery), "Timed out waiting for Go To Test button to disappear", TimeSpan.FromSeconds(10));
var text = Regex.Match (page, "'(?<text>[^']*)'").Groups["text"].Value;
app.WaitForElement("SearchBar");
app.EnterText (q => q.Raw ("* marked:'SearchBar'"), text);
app.Tap (q => q.Raw (goToTestButtonQuery));
app.WaitForNoElement (o => o.Raw (goToTestButtonQuery), "Timed out waiting for Go To Test button to disappear", TimeSpan.FromMinutes(2));
}

Просмотреть файл

@ -67,8 +67,9 @@
<HintPath>..\packages\Selenium.Support.3.0.1\lib\net40\WebDriver.Support.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.UITest">
<HintPath>..\packages\Xamarin.UITest.2.1.2\lib\net45\Xamarin.UITest.dll</HintPath>
<Reference Include="Xamarin.UITest, Version=2.1.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.UITest.2.1.4\lib\net45\Xamarin.UITest.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -6,5 +6,5 @@
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="Selenium.Support" version="3.0.1" targetFramework="net45" />
<package id="Selenium.WebDriver" version="3.0.1" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.2" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.4" targetFramework="net45" />
</packages>

Просмотреть файл

@ -58,8 +58,9 @@
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Xamarin.UITest">
<HintPath>..\packages\Xamarin.UITest.2.1.2\lib\net45\Xamarin.UITest.dll</HintPath>
<Reference Include="Xamarin.UITest, Version=2.1.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.UITest.2.1.4\lib\net45\Xamarin.UITest.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.2" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.4" targetFramework="net45" />
</packages>

Просмотреть файл

@ -29,6 +29,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Xamarin.UITest, Version=2.1.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.UITest.2.1.4\lib\net45\Xamarin.UITest.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.UITest.Desktop">
<HintPath>..\packages\Xamarin.UITest.Desktop.0.0.7\lib\net45\Xamarin.UITest.Desktop.dll</HintPath>
</Reference>
@ -63,9 +67,6 @@
<Reference Include="ServiceStack.Client">
<HintPath>..\packages\ServiceStack.Client.4.5.12\lib\net45\ServiceStack.Client.dll</HintPath>
</Reference>
<Reference Include="Xamarin.UITest">
<HintPath>..\packages\Xamarin.UITest.2.1.2\lib\net45\Xamarin.UITest.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BaseViewContainerRemoteMac.cs" />
@ -73,6 +74,7 @@
<Compile Include="MacOSApp.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />

Просмотреть файл

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -5,6 +5,6 @@
<package id="ServiceStack.Client" version="4.5.12" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="4.5.12" targetFramework="net45" />
<package id="ServiceStack.Text" version="4.5.12" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.2" targetFramework="net45" />
<package id="Xamarin.UITest" version="2.1.4" targetFramework="net45" />
<package id="Xamarin.UITest.Desktop" version="0.0.7" targetFramework="net45" />
</packages>