public void FocusInBrowserDesktop() { Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); Console.WriteLine("Install AT."); InstallATCheckService(); Console.WriteLine("Open calculator"); OpenAndCloseCalculator(); Console.WriteLine("Open browser go to any url."); OpenAndKillDefaultBrowser(); Console.WriteLine("Decrypt packets."); ExtensionRegression.StopAllServices(); var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket()); Console.WriteLine("Check Focus In."); Assert.IsTrue(focusInStore.Count >= 4, "Check focus in Behavior in packet." + focusInStore.Count); var countAppId = 0; foreach (var focusIn in focusInStore) { if (focusIn.ApplicationId.Contains("calc.exe") || focusIn.ApplicationId.Contains(url1) || focusIn.ApplicationId.Contains(ie) || focusIn.ApplicationId.Contains(url2) || focusIn.ApplicationId.Contains(ieXp)) { countAppId = countAppId + 1; } } Assert.IsTrue(countAppId >= 4, "Check applicationId in foucIn Behavior." + countAppId); Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); }
public void FocusInDesktopApp() { Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); Console.WriteLine("Install AT."); InstallATCheckService(); Console.WriteLine("Open calculator and emulate hot key."); OpenCalculator(); UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.M); OpenCalculator(); UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.D); CloseApplication("calc"); ExtensionRegression.StopAllServices(); Console.WriteLine("Decrypt packets and Check Focus In."); var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket()); Assert.IsTrue(focusInStore.Count >= 4, "Check focus in Behavior in packet."); var countAppId = 0; foreach (var focusIn in focusInStore) { if (focusIn.ApplicationId.Contains("calc.exe") || focusIn.ApplicationId.Contains("Explorer.EXE")) { countAppId = countAppId + 1; } } Assert.IsTrue(countAppId >= 4, "Check applicationId in foucIn Behavior."); Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); }
public void FocusInDifferentNameOfApp() { Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); Console.WriteLine("Install AT."); InstallATCheckService(); OpenCalculator(); UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.M); OpenCalculator(); UserInputs.PressHotKey((int)VirtualKeys.LeftWindows, (int)VirtualKeys.D); OpenAndKillDefaultBrowser(); CloseApplication("calc"); CloseApplication("iexplorer"); ExtensionRegression.StopAllServices(); var focusInStore = PacketParser.GetAllFocusInBehaviour(DecryptPacket()); Assert.IsTrue(focusInStore.Count >= 6, "Check focus in Behavior in packet.:" + focusInStore.Count); var countAppId = 0; foreach (var focusIn in focusInStore) { if (focusIn.ApplicationId.Contains("calc.exe") || focusIn.ApplicationId.Contains("Explorer.EXE") || focusIn.ApplicationId.Contains(url1) || focusIn.ApplicationId.Contains(ie) || focusIn.ApplicationId.Contains(url2)) { countAppId = countAppId + 1; } } Assert.IsTrue(countAppId >= 6, "Check applicationId in foucIn Behavior."); Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); }