diff --git a/UITests/UITests.App/DefaultPage.xaml b/UITests/UITests.App/DefaultPage.xaml
new file mode 100644
index 00000000000..9796cadd1a1
--- /dev/null
+++ b/UITests/UITests.App/DefaultPage.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/UITests/UITests.App/DefaultPage.xaml.cs b/UITests/UITests.App/DefaultPage.xaml.cs
new file mode 100644
index 00000000000..c5fa57ae8f4
--- /dev/null
+++ b/UITests/UITests.App/DefaultPage.xaml.cs
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Windows.UI.Xaml.Controls;
+
+namespace UITests.App
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class DefaultPage : Page
+ {
+ public DefaultPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/UITests/UITests.App/MainPage.xaml b/UITests/UITests.App/MainPage.xaml
index d38db07e3e3..098a892077c 100644
--- a/UITests/UITests.App/MainPage.xaml
+++ b/UITests/UITests.App/MainPage.xaml
@@ -6,14 +6,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
+ Loaded="Page_Loaded"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
-
-
-
-
-
+
diff --git a/UITests/UITests.App/MainPage.xaml.cs b/UITests/UITests.App/MainPage.xaml.cs
index b44c1291f46..d3a3821ea42 100644
--- a/UITests/UITests.App/MainPage.xaml.cs
+++ b/UITests/UITests.App/MainPage.xaml.cs
@@ -2,18 +2,79 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System;
+using System.IO;
+using System.Net;
+using System.Net.Sockets;
+using System.Threading;
+using System.Threading.Tasks;
+using Windows.UI.Core;
+using Windows.UI.Xaml;
+
namespace UITests.App
{
public sealed partial class MainPage
{
+ private static readonly string _pageNS = typeof(MainPage).Namespace + ".Pages.";
+ private NetworkStream clientStream;
+ private StreamWriter writer;
+
public MainPage()
{
InitializeComponent();
}
- private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
+ private void Page_Loaded(object sender, RoutedEventArgs e)
{
- textBlock.Text = "Clicked";
+ navigationFrame.Navigate(typeof(DefaultPage));
+
+ Task.Run(ConnectToTestDriver);
+ }
+
+ private void ConnectToTestDriver()
+ {
+ var client = new TcpClient();
+ client.ConnectAsync(IPAddress.Loopback, 13000);
+
+ clientStream = client.GetStream();
+ writer = new StreamWriter(clientStream)
+ {
+ AutoFlush = true
+ };
+
+ writer.WriteLine("Ready");
+
+ var thread = new Thread(new ThreadStart(ListenForPageRequest));
+ thread.Start();
+ }
+
+ private void ListenForPageRequest()
+ {
+ var reader = new StreamReader(clientStream);
+
+ while (true)
+ {
+ try
+ {
+ if (reader.ReadLine() is string request)
+ {
+ var type = Type.GetType(_pageNS + request);
+ Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => navigationFrame.Navigate(type))
+ .AsTask()
+ .ContinueWith(_ => writer.WriteLine("Opened " + request));
+ }
+ else
+ {
+ // The server has disconnected
+ break;
+ }
+ }
+ catch
+ {
+ // A socket error has occurred
+ break;
+ }
+ }
}
}
}
diff --git a/UITests/UITests.App/Package.appxmanifest b/UITests/UITests.App/Package.appxmanifest
index a17d7b8e653..6e55a84ad3d 100644
--- a/UITests/UITests.App/Package.appxmanifest
+++ b/UITests/UITests.App/Package.appxmanifest
@@ -45,5 +45,6 @@
+
\ No newline at end of file
diff --git a/UITests/UITests.App/Pages/Controls/TextBoxMaskTestPage.xaml b/UITests/UITests.App/Pages/Controls/TextBoxMaskTestPage.xaml
new file mode 100644
index 00000000000..96ce0c21194
--- /dev/null
+++ b/UITests/UITests.App/Pages/Controls/TextBoxMaskTestPage.xaml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UITests/UITests.App/Pages/Controls/TextBoxMaskTestPage.xaml.cs b/UITests/UITests.App/Pages/Controls/TextBoxMaskTestPage.xaml.cs
new file mode 100644
index 00000000000..f872d27017e
--- /dev/null
+++ b/UITests/UITests.App/Pages/Controls/TextBoxMaskTestPage.xaml.cs
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+namespace UITests.App.Pages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class TextBoxMaskTestPage : Page
+ {
+ private const string INITIAL_VALUE = "12:50:59";
+ private const string NEW_VALUE = "00:00:00";
+
+ public string InitialValue => INITIAL_VALUE;
+
+ public string NewValue => NEW_VALUE;
+
+ public string Value
+ {
+ get { return (string)GetValue(ValueProperty); }
+ set { SetValue(ValueProperty, value); }
+ }
+
+ public static readonly DependencyProperty ValueProperty =
+ DependencyProperty.Register(nameof(Value), typeof(string), typeof(TextBoxMaskTestPage), new PropertyMetadata(INITIAL_VALUE));
+
+ public TextBoxMaskTestPage()
+ {
+ this.InitializeComponent();
+ }
+
+ private void ChangeButton_Click(object sender, RoutedEventArgs e)
+ {
+ Value = NEW_VALUE;
+ }
+ }
+}
diff --git a/UITests/UITests.App/Pages/SimpleTest.xaml b/UITests/UITests.App/Pages/SimpleTest.xaml
new file mode 100644
index 00000000000..1ab5d6484bc
--- /dev/null
+++ b/UITests/UITests.App/Pages/SimpleTest.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/UITests/UITests.App/Pages/SimpleTest.xaml.cs b/UITests/UITests.App/Pages/SimpleTest.xaml.cs
new file mode 100644
index 00000000000..db474735c36
--- /dev/null
+++ b/UITests/UITests.App/Pages/SimpleTest.xaml.cs
@@ -0,0 +1,25 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+namespace UITests.App.Pages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class SimpleTest : Page
+ {
+ public SimpleTest()
+ {
+ this.InitializeComponent();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ textBlock.Text = "Clicked";
+ }
+ }
+}
diff --git a/UITests/UITests.App/UITests.App.csproj b/UITests/UITests.App/UITests.App.csproj
index 48fc8de5936..b11634a50c2 100644
--- a/UITests/UITests.App/UITests.App.csproj
+++ b/UITests/UITests.App/UITests.App.csproj
@@ -40,6 +40,7 @@
false
prompt
true
+ 8.0
bin\x86\Release\
@@ -52,6 +53,7 @@
prompt
true
true
+ 8.0
true
@@ -63,6 +65,7 @@
false
prompt
true
+ 8.0
bin\ARM\Release\
@@ -75,6 +78,7 @@
prompt
true
true
+ 8.0
true
@@ -87,6 +91,7 @@
prompt
true
true
+ 8.0
bin\ARM64\Release\
@@ -99,6 +104,7 @@
prompt
true
true
+ 8.0
true
@@ -110,6 +116,7 @@
false
prompt
true
+ 8.0
bin\x64\Release\
@@ -122,6 +129,7 @@
prompt
true
true
+ 8.0
PackageReference
@@ -130,9 +138,18 @@
App.xaml
+
+ DefaultPage.xaml
+
MainPage.xaml
+
+ SimpleTest.xaml
+
+
+ TextBoxMaskTestPage.xaml
+
@@ -155,10 +172,22 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
@@ -252,4 +281,4 @@
-->
-
+
\ No newline at end of file
diff --git a/UITests/UITests.Tests.Shared/Tests.cs b/UITests/UITests.Tests.Shared/Tests.cs
index bba017d8c9e..56cee816924 100644
--- a/UITests/UITests.Tests.Shared/Tests.cs
+++ b/UITests/UITests.Tests.Shared/Tests.cs
@@ -5,6 +5,8 @@
using System;
using System.IO;
using System.Linq;
+using System.Net;
+using System.Net.Sockets;
using System.Reflection;
using Microsoft.Windows.Apps.Test.Foundation.Controls;
using Windows.UI.Xaml.Tests.MUXControls.InteractionTests.Common;
@@ -23,6 +25,9 @@ namespace UITests.Tests
[TestClass]
public class Tests
{
+ private static StreamReader _streamReader;
+ private static StreamWriter _streamWriter;
+
public static TestApplicationInfo WinUICsUWPSampleApp
{
get
@@ -83,7 +88,18 @@ public static TestSetupHelper.TestSetupHelperOptions TestSetupHelperOptions
[TestProperty("Platform", "Any")]
public static void ClassInitialize(TestContext testContext)
{
+ var listener = new TcpListener(IPAddress.Loopback, 13000);
+ listener.Start();
+
TestEnvironment.Initialize(testContext, WinUICsUWPSampleApp);
+
+ var client = listener.AcceptTcpClient();
+
+ var stream = client.GetStream();
+ _streamReader = new StreamReader(stream);
+ _streamWriter = new StreamWriter(stream);
+
+ Verify.AreEqual("Ready", _streamReader.ReadLine());
}
[ClassCleanup]
@@ -98,8 +114,10 @@ public void TestCleanup()
}
[TestMethod]
- public void SimpleLaunchTest()
+ public void SimpleTest()
{
+ Verify.IsTrue(OpenTest("SimpleTest"));
+
var button = new Button(FindElement.ByName("Click Me"));
var textBlock = new TextBlock(FindElement.ById("textBlock"));
@@ -113,5 +131,32 @@ public void SimpleLaunchTest()
Verify.AreEqual("Clicked", textBlock.GetText());
}
+
+ [TestMethod]
+ public void TestTextBoxMaskBinding_Property()
+ {
+ Verify.IsTrue(OpenTest("TextBoxMaskTestPage"));
+
+ var initialValue = FindElement.ById("InitialValueTextBlock").GetText();
+ var textBox = FindElement.ById("TextBox");
+
+ Verify.AreEqual(initialValue, textBox.GetText());
+
+ var changeButton = FindElement.ById