mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
WinAppDriver tests update (#5882)
* tray button fix * settings closing changed * ignore old settings tests * changed test init * changed launch * separated app history file * select enabled modules on launch
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
@@ -9,13 +9,12 @@ namespace PowerToysTests
|
||||
{
|
||||
private void ApplyLayout(string tabName)
|
||||
{
|
||||
string elementXPath = "//Text[@Name=\"" + tabName + "\"]";
|
||||
session.FindElementByXPath(elementXPath).Click();
|
||||
session.FindElementByAccessibilityId("ApplyTemplateButton").Click();
|
||||
editorWindow.FindElementByName(tabName).Click();
|
||||
editorWindow.FindElementByAccessibilityId("ApplyTemplateButton").Click();
|
||||
|
||||
try
|
||||
{
|
||||
Assert.IsNull(session.FindElementByXPath("//Window[@Name=\"FancyZones Editor\"]"));
|
||||
Assert.IsNull(session.FindElementByName("FancyZones Editor"));
|
||||
}
|
||||
catch (OpenQA.Selenium.WebDriverException)
|
||||
{
|
||||
@@ -67,9 +66,9 @@ namespace PowerToysTests
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext context)
|
||||
{
|
||||
Setup(context, false);
|
||||
if (session == null)
|
||||
return;
|
||||
Setup(context);
|
||||
Assert.IsNotNull(session);
|
||||
EnableModules(false, true, false, false, false, false, false, false);
|
||||
|
||||
ResetDefaultFancyZonesSettings(true);
|
||||
}
|
||||
@@ -78,16 +77,14 @@ namespace PowerToysTests
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
CloseSettings();
|
||||
ExitPowerToys();
|
||||
TearDown();
|
||||
}
|
||||
|
||||
[TestInitialize]
|
||||
public void TestInitialize()
|
||||
{
|
||||
if (session == null)
|
||||
return;
|
||||
|
||||
OpenEditor();
|
||||
Assert.IsTrue(OpenEditor());
|
||||
OpenTemplates();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user