Try process killing approach

This commit is contained in:
Gleb Khmyznikov
2025-12-05 11:52:31 -08:00
parent 280d58d98e
commit a02e60b90d

View File

@@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using FancyZonesEditor.Models; using FancyZonesEditor.Models;
@@ -49,18 +50,16 @@ namespace UITests_FancyZones
[TestInitialize] [TestInitialize]
public void TestInitialize() public void TestInitialize()
{ {
Session.KillAllProcessesByName("PowerToys");
Thread.Sleep(1000);
ClearOpenWindows();
SettingsConfigHelper.ConfigureGlobalModuleSettings("Hosts"); SettingsConfigHelper.ConfigureGlobalModuleSettings("Hosts");
// kill all processes related to FancyZones Editor to ensure a clean state
Session.KillAllProcessesByName("PowerToys.FancyZonesEditor");
AppZoneHistory.DeleteFile(); AppZoneHistory.DeleteFile();
FancyZonesEditorHelper.Files.Restore(); FancyZonesEditorHelper.Files.Restore();
// ClearOpenWindows - do this after file operations to ensure Session is ready
ClearOpenWindows();
RestartScopeExe(); RestartScopeExe();
Thread.Sleep(2000);
// Set a custom layout with 1 subzones and clear app zone history // Set a custom layout with 1 subzones and clear app zone history
SetupCustomLayouts(); SetupCustomLayouts();