mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Editor tests: apply templates (#1648)
* apply templates tests * moved settings reset methods
This commit is contained in:
@@ -226,6 +226,39 @@ namespace PowerToysTests
|
||||
session.FindElementByXPath("//MenuItem[@Name=\"Exit\"]").Click();
|
||||
trayButton.Click(); //close tray
|
||||
isPowerToysLaunched = false;
|
||||
}
|
||||
|
||||
public static void ResetDefaultFancyZonesSettings(bool relaunch)
|
||||
{
|
||||
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);
|
||||
|
||||
if (isPowerToysLaunched)
|
||||
{
|
||||
ExitPowerToys();
|
||||
}
|
||||
|
||||
if (relaunch)
|
||||
{
|
||||
LaunchPowerToys();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResetDefautZoneSettings(bool relaunch)
|
||||
{
|
||||
string zoneSettings = "{\"app-zone-history\":[],\"devices\":[],\"custom-zone-sets\":[]}";
|
||||
File.WriteAllText(_zoneSettingsPath, zoneSettings);
|
||||
|
||||
ExitPowerToys();
|
||||
if (relaunch)
|
||||
{
|
||||
LaunchPowerToys();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user