mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
correctin file ending (#5970)
This commit is contained in:
@@ -13,9 +13,9 @@ namespace PowerToysTests
|
||||
File.Delete(_zoneSettingsPath);
|
||||
}
|
||||
|
||||
void RemoveSettingsFolder()
|
||||
{
|
||||
Directory.Delete(_settingsFolderPath, true);
|
||||
void RemoveSettingsFolder()
|
||||
{
|
||||
Directory.Delete(_settingsFolderPath, true);
|
||||
}
|
||||
|
||||
void CreateEmptySettingsFile()
|
||||
@@ -48,56 +48,56 @@ namespace PowerToysTests
|
||||
File.WriteAllText(_zoneSettingsPath, zoneSettings);
|
||||
}
|
||||
|
||||
void CreateCroppedSettingsFile()
|
||||
{
|
||||
void CreateCroppedSettingsFile()
|
||||
{
|
||||
string zoneSettings = "{\"app-zone-history\":[],\"devices\":[],\"custom-zone-sets\":[{\"uuid\":\"{8BEC7183-C90E-4D41-AD1C-1AC2BC4760BA}\",\"name\":\"";
|
||||
File.WriteAllText(_zoneSettingsPath, zoneSettings);
|
||||
File.WriteAllText(_zoneSettingsPath, zoneSettings);
|
||||
}
|
||||
|
||||
void TestEditorOpened()
|
||||
{
|
||||
WindowsElement errorMessage = null;
|
||||
try
|
||||
{
|
||||
errorMessage = WaitElementByName("FancyZones Editor Exception Handler");
|
||||
if (errorMessage != null)
|
||||
{
|
||||
errorMessage.FindElementByName("OK").Click();
|
||||
}
|
||||
void TestEditorOpened()
|
||||
{
|
||||
WindowsElement errorMessage = null;
|
||||
try
|
||||
{
|
||||
errorMessage = WaitElementByName("FancyZones Editor Exception Handler");
|
||||
if (errorMessage != null)
|
||||
{
|
||||
errorMessage.FindElementByName("OK").Click();
|
||||
}
|
||||
}
|
||||
catch (OpenQA.Selenium.WebDriverException)
|
||||
{
|
||||
//no error message, it's ok
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
editorWindow = session.FindElementByXPath("//Window[@Name=\"FancyZones Editor\"]");
|
||||
}
|
||||
{
|
||||
//no error message, it's ok
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
editorWindow = session.FindElementByXPath("//Window[@Name=\"FancyZones Editor\"]");
|
||||
}
|
||||
catch (OpenQA.Selenium.WebDriverException)
|
||||
{
|
||||
}
|
||||
|
||||
Assert.IsNotNull(editorWindow);
|
||||
Assert.IsNull(errorMessage);
|
||||
{
|
||||
}
|
||||
|
||||
Assert.IsNotNull(editorWindow);
|
||||
Assert.IsNull(errorMessage);
|
||||
}
|
||||
|
||||
void OpenEditorBySettingsButton()
|
||||
{
|
||||
OpenSettings();
|
||||
void OpenEditorBySettingsButton()
|
||||
{
|
||||
OpenSettings();
|
||||
OpenFancyZonesSettings();
|
||||
|
||||
WindowsElement editorButton = session.FindElementByXPath("//Button[@Name=\"Edit zones\"]");
|
||||
Assert.IsNotNull(editorButton);
|
||||
|
||||
editorButton.Click();
|
||||
TestEditorOpened();
|
||||
TestEditorOpened();
|
||||
}
|
||||
|
||||
void OpenEditorByHotkey()
|
||||
{
|
||||
void OpenEditorByHotkey()
|
||||
{
|
||||
new Actions(session).KeyDown(OpenQA.Selenium.Keys.Command).SendKeys("`").KeyUp(OpenQA.Selenium.Keys.Command).Perform();
|
||||
TestEditorOpened();
|
||||
TestEditorOpened();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -111,15 +111,15 @@ namespace PowerToysTests
|
||||
public void OpenEditorBySettingsButtonNoSettingsFolder()
|
||||
{
|
||||
/*
|
||||
if (isPowerToysLaunched)
|
||||
{
|
||||
ExitPowerToys();
|
||||
if (isPowerToysLaunched)
|
||||
{
|
||||
ExitPowerToys();
|
||||
}
|
||||
RemoveSettingsFolder();
|
||||
LaunchPowerToys();
|
||||
*/
|
||||
|
||||
RemoveSettingsFolder();
|
||||
|
||||
RemoveSettingsFolder();
|
||||
OpenEditorBySettingsButton();
|
||||
}
|
||||
|
||||
@@ -156,33 +156,33 @@ namespace PowerToysTests
|
||||
{
|
||||
CreateInvalidSettingsFile();
|
||||
OpenEditorBySettingsButton();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void OpenEditorBySettingsButtonCroppedSettings()
|
||||
{
|
||||
CreateCroppedSettingsFile();
|
||||
OpenEditorBySettingsButton();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void OpenEditorByHotkeyNoSettings()
|
||||
{
|
||||
RemoveSettingsFile();
|
||||
OpenEditorByHotkey();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void OpenEditorByHotkeyNoSettingsFolder()
|
||||
{
|
||||
/*
|
||||
if (isPowerToysLaunched)
|
||||
{
|
||||
ExitPowerToys();
|
||||
if (isPowerToysLaunched)
|
||||
{
|
||||
ExitPowerToys();
|
||||
}
|
||||
RemoveSettingsFolder();
|
||||
LaunchPowerToys();
|
||||
*/
|
||||
LaunchPowerToys();
|
||||
*/
|
||||
RemoveSettingsFolder();
|
||||
OpenEditorByHotkey();
|
||||
}
|
||||
@@ -233,7 +233,7 @@ namespace PowerToysTests
|
||||
public static void ClassInitialize(TestContext context)
|
||||
{
|
||||
Setup(context, false);
|
||||
if (session == null)
|
||||
if (session == null)
|
||||
return;
|
||||
|
||||
ResetDefaultFancyZonesSettings(true);
|
||||
@@ -241,25 +241,25 @@ namespace PowerToysTests
|
||||
|
||||
[ClassCleanup]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
ExitPowerToys();
|
||||
{
|
||||
ExitPowerToys();
|
||||
TearDown();
|
||||
}
|
||||
|
||||
[TestInitialize]
|
||||
public void TestInitialize()
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
public void TestCleanup()
|
||||
{
|
||||
CloseEditor();
|
||||
|
||||
if (!Directory.Exists(_settingsFolderPath))
|
||||
{
|
||||
Directory.CreateDirectory(_settingsFolderPath);
|
||||
CloseEditor();
|
||||
|
||||
if (!Directory.Exists(_settingsFolderPath))
|
||||
{
|
||||
Directory.CreateDirectory(_settingsFolderPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user