public void Debug_WhenUsingQuickDebugCommand_ExpectSavedInputsUsedInExecution() { // Remove the PersistSettings.dat ;) var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", ""); var settingPath = Path.Combine(appData, @"Local\Warewolf\DebugData\PersistSettings.dat"); if (File.Exists(settingPath)) { File.Delete(settingPath); } //------------Setup for test-------------------------- //Open the correct workflow ExplorerUIMap.DoubleClickWorkflow("Bug9394", "TestCategory"); // prime the values ;) RibbonUIMap.ClickDebug(); DebugUIMap.EnterTextIntoRow(0, "1"); DebugUIMap.EnterTextIntoRow(1, "2"); DebugUIMap.ClickExecute(); OutputUIMap.WaitForExecution(); RibbonUIMap.ClickDebug(); DebugUIMap.CloseDebugWindow_ByCancel(); //---------------Execute------------------------------ SendKeys.SendWait(KeyboardCommands.QuickDebug); //------------Assert Results------------------------- OutputUIMap.WaitForExecution(); UITestControl lastStep = OutputUIMap.GetLastStep(); string workflowStepName = OutputUIMap.GetStepName(lastStep); Assert.AreEqual("Bug9394", workflowStepName); }
public void DebugInput_WhenRun10Times_ExpectInputsPersistAndXMLRemainsLinked_InputsAndXMLRemainPersisted() { // Remove the PersistSettings.dat ;) var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", ""); var settingPath = Path.Combine(appData, @"Local\Warewolf\DebugData\PersistSettings.dat"); if (File.Exists(settingPath)) { File.Delete(settingPath); } //------------Setup for test-------------------------- //Open the correct workflow ExplorerUIMap.DoubleClickWorkflow("Bug9394", "TestCategory"); // prime the values ;) RibbonUIMap.ClickDebug(); DebugUIMap.EnterTextIntoRow(0, "1"); DebugUIMap.EnterTextIntoRow(1, "2"); DebugUIMap.ClickExecute(); OutputUIMap.WaitForExecution(); //------------Assert Results------------------------- // Check for valid input in the input boxes ;) for (int i = 0; i < 9; i++) { RibbonUIMap.ClickDebug(); DebugUIMap.WaitForDebugWindow(7000); Assert.AreEqual("1", DebugUIMap.GetTextFromRow(0), "After executing " + i + " times the debug input dialog did not persist"); Assert.AreEqual("2", DebugUIMap.GetTextFromRow(1), "After executing " + i + " times the debug input dialog did not persist"); DebugUIMap.ClickExecute(); OutputUIMap.WaitForExecution(); } //Now check the XML tab works ;) RibbonUIMap.ClickDebug(); DebugUIMap.ClickXMLTab(); // flip back and forth to check persistence ;) DebugUIMap.ClickInputDataTab(); DebugUIMap.ClickXMLTab(); SendKeys.SendWait(KeyboardCommands.TabCommand); Playback.Wait(200); SendKeys.SendWait(KeyboardCommands.SelectAllCommand); Playback.Wait(200); Clipboard.Clear(); SendKeys.SendWait(KeyboardCommands.CopyCommand); var actualXML = Clipboard.GetData(DataFormats.Text); actualXML = actualXML.ToString().Replace(Environment.NewLine, "").Replace(" ", ""); //close the window ;) DebugUIMap.CloseDebugWindow_ByCancel(); const string expectedXML = @"<DataList><countries><CountryID>1</CountryID><Description>2</Description></countries></DataList>"; Assert.AreEqual(expectedXML, actualXML, "Got [ " + actualXML + " ]"); }