Editor tests: apply templates (#1648)

* apply templates tests
* moved settings reset methods
This commit is contained in:
Seraphima Zykova
2020-03-24 11:32:12 +03:00
committed by GitHub
parent 6f2801cea8
commit e32d619677
4 changed files with 163 additions and 22 deletions

View File

@@ -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();
}
}
}
}