mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
Editor tests: apply templates (#1648)
* apply templates tests * moved settings reset methods
This commit is contained in:
@@ -11,23 +11,6 @@ namespace PowerToysTests
|
||||
{
|
||||
WindowsElement editorWindow;
|
||||
|
||||
private static void ResetDefaultFancyZonesSettings()
|
||||
{
|
||||
if (!Directory.Exists(_settingsFolderPath))
|
||||
{
|
||||
Directory.CreateDirectory(_settingsFolderPath);
|
||||
}
|
||||
|
||||
string settings = "{\"version\":\"1.0\",\"name\":\"FancyZones\",\"properties\":{\"fancyzones_shiftDrag\":{\"value\":true},\"fancyzones_overrideSnapHotkeys\":{\"value\":false},\"fancyzones_zoneSetChange_flashZones\":{\"value\":false},\"fancyzones_displayChange_moveWindows\":{\"value\":false},\"fancyzones_zoneSetChange_moveWindows\":{\"value\":false},\"fancyzones_virtualDesktopChange_moveWindows\":{\"value\":false},\"fancyzones_appLastZone_moveWindows\":{\"value\":false},\"use_cursorpos_editor_startupscreen\":{\"value\":true},\"fancyzones_zoneHighlightColor\":{\"value\":\"#0078D7\"},\"fancyzones_highlight_opacity\":{\"value\":90},\"fancyzones_editor_hotkey\":{\"value\":{\"win\":true,\"ctrl\":false,\"alt\":false,\"shift\":false,\"code\":192,\"key\":\"`\"}},\"fancyzones_excluded_apps\":{\"value\":\"\"}}}";
|
||||
File.WriteAllText(_settingsPath, settings);
|
||||
}
|
||||
|
||||
private void ResetDefautZoneSettings()
|
||||
{
|
||||
string zoneSettings = "{\"app-zone-history\":[],\"devices\":[],\"custom-zone-sets\":[]}";
|
||||
File.WriteAllText(_zoneSettingsPath, zoneSettings);
|
||||
}
|
||||
|
||||
private void OpenEditor()
|
||||
{
|
||||
new Actions(session).KeyDown(OpenQA.Selenium.Keys.Command).SendKeys("`").KeyUp(OpenQA.Selenium.Keys.Command).Perform();
|
||||
@@ -166,8 +149,7 @@ namespace PowerToysTests
|
||||
{
|
||||
ExitPowerToys();
|
||||
}
|
||||
ResetDefaultFancyZonesSettings();
|
||||
LaunchPowerToys();
|
||||
ResetDefaultFancyZonesSettings(true);
|
||||
}
|
||||
|
||||
[ClassCleanup]
|
||||
@@ -205,8 +187,7 @@ namespace PowerToysTests
|
||||
//editor has already closed
|
||||
}
|
||||
|
||||
ResetDefautZoneSettings();
|
||||
ExitPowerToys();
|
||||
ResetDefautZoneSettings(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user