add Session Init in UITestBase.cs

This commit is contained in:
Zhaopeng Wang (from Dev Box)
2025-02-13 16:37:09 +08:00
parent 7913941c04
commit 4cd4fc8490
2 changed files with 3 additions and 3 deletions

View File

@@ -27,17 +27,20 @@ namespace Microsoft.PowerToys.UITest
public UITestBase()
{
SessionManager.Init();
Session = SessionManager.Current;
}
public UITestBase(PowerToysModule scope)
{
SessionManager.SetScope(scope);
SessionManager.Init();
Session = SessionManager.Current;
}
~UITestBase()
{
SessionManager.UnInit();
Session = null;
}
public static void Enable_Module_from_Dashboard(string moduleName, PowerToysModuleWindow module = PowerToysModuleWindow.None)

View File

@@ -20,9 +20,6 @@ namespace UITests_FancyZones
public void RunFancyZones()
{
Thread.Sleep(2000);
Session = SessionManager.Current;
Assert.IsNotNull(Session, "Session is null");
Session?.FindElementByName<Element>("Launch layout editor").Click();
Thread.Sleep(4000);
Session = SessionManager.AttachSession(PowerToysModuleWindow.Fancyzone);