Skip to content

WinUI - Test Infra #3482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
30 commits merged into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
31b443b
Created UITest using WinUI's shared infrastructure.
azchohfi Aug 28, 2020
80e447c
Added MUX-Dependencies to nuget.config.
azchohfi Aug 28, 2020
fa0d097
Fix for correct cert and appx detection on TAEF tests.
azchohfi Aug 28, 2020
60ceab5
Updated test app package name.
azchohfi Sep 10, 2020
b0de1b9
Merge branch 'master' into muxtestinfra
azchohfi Sep 10, 2020
05c7d48
Added headers.
azchohfi Sep 10, 2020
4b97775
Added correct Nuget package source.
azchohfi Sep 10, 2020
4a5402c
Added UITests to build pipeline
azchohfi Sep 10, 2020
363a3cf
Switched from TAEF to MSTest for UI Tests
azchohfi Sep 11, 2020
a13fe1f
Updated UI tests to net core 3.1.
azchohfi Sep 11, 2020
514a419
Merge branch 'master' into muxtestinfra
azchohfi Sep 14, 2020
d7f3f5b
Increased build timeout.
azchohfi Sep 11, 2020
99f18d6
Timeout tests.
azchohfi Sep 14, 2020
666d354
Merge branch 'master' into muxtestinfra
azchohfi Sep 18, 2020
b725cb8
Switched back to TAEF for UI Tests. Added build task to enable runnin…
azchohfi Sep 18, 2020
7c6918e
Merge branch 'master' into muxtestinfra
azchohfi Sep 22, 2020
6af0372
Update UITests.App.csproj
azchohfi Sep 22, 2020
00e1ab6
Updated to support MSIX
azchohfi Sep 23, 2020
63cf3ce
Updated taef uitests to support both debug and release.
azchohfi Sep 23, 2020
d0bd8ab
Ignoring WexLogFileOutput when there are no issues.
azchohfi Sep 23, 2020
de6ffd5
Merge branch 'master' into muxtestinfra
azchohfi Sep 24, 2020
551f2b0
Merge branch 'master' into muxtestinfra
azchohfi Sep 24, 2020
25b6ca7
Added TAEF Logs
azchohfi Sep 24, 2020
8528591
Merge branch 'master' into muxtestinfra
azchohfi Sep 25, 2020
ef749d6
Merge branch 'master' into muxtestinfra
Rosuavio Oct 1, 2020
c9b98c2
Merge branch 'master' into muxtestinfra
michael-hawker Oct 6, 2020
4edacdc
Merge branch 'master' into muxtestinfra
Rosuavio Oct 8, 2020
dd52af5
UITest: ref csproj indead of vcxproj
Rosuavio Oct 8, 2020
1c5ef76
Merge branch 'master' into muxtestinfra
Rosuavio Oct 12, 2020
78bc06f
Merge branch 'master' into muxtestinfra
michael-hawker Oct 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,8 @@ msbuild.binlog
!/build/tools/packages.config

# Generated file from .ttinclude
**/Generated/TypeInfo.g.cs
**/Generated/TypeInfo.g.cs

# TAEF Log output
WexLogFileOutput
*.wtl
7 changes: 7 additions & 0 deletions UITests/UITests.App/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Application
x:Class="UITests.App.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UITests.App">

</Application>
89 changes: 89 additions & 0 deletions UITests/UITests.App/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// 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 System;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace UITests.App
{
public sealed partial class App
{
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}

/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;

// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();

rootFrame.NavigationFailed += OnNavigationFailed;

if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Load state from previously suspended application
}

// Place the frame in the current Window
Window.Current.Content = rootFrame;
}

if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}

// Ensure the current window is active
Window.Current.Activate();
}
}

/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}

/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();

// TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added UITests/UITests.App/Assets/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions UITests/UITests.App/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page
x:Class="UITests.App.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:testhelpers="using:AppTestAutomationHelpers"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<testhelpers:TestAutomationHelpersPanel />

<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="Click Me" Click="Button_Click"/>
<TextBlock x:Name="textBlock"/>
</StackPanel>
</Grid>
</Page>
19 changes: 19 additions & 0 deletions UITests/UITests.App/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -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.

namespace UITests.App
{
public sealed partial class MainPage
{
public MainPage()
{
InitializeComponent();
}

private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
textBlock.Text = "Clicked";
}
}
}
49 changes: 49 additions & 0 deletions UITests/UITests.App/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">

<Identity
Name="3568ebdf-5b6b-4ddd-bb17-462d614ba50f"
Publisher="CN=alzollin"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="3568ebdf-5b6b-4ddd-bb17-462d614ba50f" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>UITests.App</DisplayName>
<PublisherDisplayName>alzollin</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="UITests.App.App">
<uap:VisualElements
DisplayName="UITests.App"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="UITests.App"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
30 changes: 30 additions & 0 deletions UITests/UITests.App/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 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 System.Reflection;
using System.Runtime.InteropServices;

// 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("UITests.App")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UITests.App")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 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: ComVisible(false)]
31 changes: 31 additions & 0 deletions UITests/UITests.App/Properties/Default.rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.

Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919

To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>

To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />

Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />


<!-- Add your application specific runtime directives here. -->


</Application>
</Directives>
Loading