Hello GitHub
This commit is contained in:
51
internal/Calculator.UITests/Tests/AppLifecycleTests.cs
Normal file
51
internal/Calculator.UITests/Tests/AppLifecycleTests.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Etw.Managed;
|
||||
using Microsoft.Windows.Apps.Performance;
|
||||
using WEX.Logging.Interop;
|
||||
using WEX.TestExecution;
|
||||
using WEX.TestExecution.Markup;
|
||||
using Calculator.UIAutomationLibrary;
|
||||
|
||||
namespace Calculator.PerfTests
|
||||
{
|
||||
[TestClass]
|
||||
public class AppLifecycleTests
|
||||
{
|
||||
[TestInitialize]
|
||||
[TestProperty("RunAs", "ElevatedUserOrSystem")]
|
||||
public void MethodSetup()
|
||||
{
|
||||
Utilities.KillExistingCalculatorProcesses();
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
[TestProperty("RunAs", "ElevatedUserOrSystem")]
|
||||
public void MethodCleanup()
|
||||
{
|
||||
Utilities.KillExistingCalculatorProcesses();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method executes the AppLifecycle performance test.
|
||||
/// The test launches the application, suspend and resumes it and then terminates the app.
|
||||
///
|
||||
/// A TAEF data source is used to specify the Windows Performance Recorder profile and
|
||||
/// regions of interest file to use and defines threee different configurations to execute this test with.
|
||||
/// Cold: The initial run to get dlls loaded into memory and to execute any first-run app logic.
|
||||
/// Warm: The run that will produce consistent results and that would be used for measures.
|
||||
/// Memory: A run that is focused on collecting more info on allocations.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
[TestProperty("RunAs", "User")]
|
||||
[TestProperty("Category", "Performance")]
|
||||
[TestProperty(WinperfConstants.DataSource, PerfConstants.AppLifecycleInterationsSource)]
|
||||
public void AppLifecycleTest()
|
||||
{
|
||||
AppLifecycle.Run(Constants.PackageAppUserModelId);
|
||||
}
|
||||
}
|
||||
}
|
49
internal/Calculator.UITests/Tests/CalculatorTests.cs
Normal file
49
internal/Calculator.UITests/Tests/CalculatorTests.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using Calculator.UIAutomationLibrary;
|
||||
using Calculator.UIAutomationLibrary.Tests;
|
||||
using WEX.TestExecution.Markup;
|
||||
|
||||
namespace Calculator.UITests
|
||||
{
|
||||
[TestClass]
|
||||
public class CalculatorTests
|
||||
{
|
||||
[TestInitialize]
|
||||
[TestProperty("RunAs", "ElevatedUserOrSystem")]
|
||||
public void MethodSetup()
|
||||
{
|
||||
Utilities.KillExistingCalculatorProcesses();
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
[TestProperty("RunAs", "ElevatedUserOrSystem")]
|
||||
public void MethodCleanup()
|
||||
{
|
||||
Utilities.KillExistingCalculatorProcesses();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestProperty("RunAs", "User")]
|
||||
public void OnePlusTwoTest()
|
||||
{
|
||||
var calculatorLfm = CalculatorAppLauncher.Launch();
|
||||
|
||||
calculatorLfm.CalculateOnePlusTwo();
|
||||
|
||||
calculatorLfm.Close();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestProperty("RunAs", "User")]
|
||||
public void Sqrt4Minus2Test()
|
||||
{
|
||||
var calculatorLfm = CalculatorAppLauncher.Launch();
|
||||
|
||||
calculatorLfm.CalculateSqrt4Minus2();
|
||||
|
||||
calculatorLfm.Close();
|
||||
}
|
||||
}
|
||||
}
|
43
internal/Calculator.UITests/Tests/LaunchTests.cs
Normal file
43
internal/Calculator.UITests/Tests/LaunchTests.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using MS.Internal.Mita.Foundation;
|
||||
using MS.Internal.Mita.Foundation.Controls;
|
||||
using MS.Internal.Mita.Foundation.Waiters;
|
||||
using System;
|
||||
using WEX.TestExecution;
|
||||
using WEX.TestExecution.Markup;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.OneCoreUap.Test.AppModel;
|
||||
using System.IO;
|
||||
using Calculator.UITests;
|
||||
using Calculator.UIAutomationLibrary;
|
||||
|
||||
namespace Calculator.UITests
|
||||
{
|
||||
[TestClass]
|
||||
public class LaunchTests
|
||||
{
|
||||
[TestInitialize]
|
||||
[TestProperty("RunAs", "ElevatedUserOrSystem")]
|
||||
public void MethodSetup()
|
||||
{
|
||||
Utilities.KillExistingCalculatorProcesses();
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
[TestProperty("RunAs", "ElevatedUserOrSystem")]
|
||||
public void MethodCleanup()
|
||||
{
|
||||
Utilities.KillExistingCalculatorProcesses();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestProperty("RunAs", "User")]
|
||||
public void NormalLaunchTest()
|
||||
{
|
||||
var calculatorLfm = CalculatorAppLauncher.Launch();
|
||||
calculatorLfm.Close();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user