public void Form_Delete_Unused() { Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString()); var mainMenu = new MainMenu(Driver); var formMenu = new SubMenuForms(Driver); var formPages = new FormPages(Driver); var formWorkflow = new FormWorkflows(Driver, test); try //Contains Contents of Test { //test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]); // create the form and get the id var newFormId = formWorkflow.CreateForm(); test.Log(LogStatus.Pass, "Create the form"); Console.WriteLine("Attemping to delete form with ID {0}", newFormId); // navigate to Forms > Design Forms and Packets > Edit Forms Driver.SwitchToDefaultFrame(); mainMenu.ClickMainMenuTab(); mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickEditForms(); test.Log(LogStatus.Pass, "Navigate to Main Menu > Forms > Design Forms and Packets > Edit Forms"); // select the form in the list Driver.SwitchToFrameById("MainContentsIFrame"); formPages.EditFormsPage.SelectForm(newFormId); test.Log(LogStatus.Pass, "Select the form from the list"); // delete the form Driver.SwitchToDefaultFrame(); formMenu.ClickDeleteForms(); test.Log(LogStatus.Pass, "Click Delete Forms"); formPages.EditFormsPage.ConfirmDeletion(); test.Log(LogStatus.Pass, "Confirm the deletion"); // verify that the form was deleted Driver.SwitchToDefaultFrame(); mainMenu.ClickMainMenuTab(); mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickEditForms(); Driver.SwitchToFrameById("MainContentsIFrame"); Assert.IsFalse(formPages.EditFormsPage.FormExists(newFormId)); test.Log(LogStatus.Pass, "Form deleted"); Console.Out.WriteLineAsync("Form Deleted"); } catch (Exception e) //On Error Do { HandleException(e, Driver); throw; } }
/// <summary> /// Delete a form for testing purposes. This will only work if the form to be deleted has not been used. /// </summary> /// <param name="formId">The ID of the form to be deleted.</param> public void DeleteForm(int formId) { Console.WriteLine("WindowHandle at Start: " + _driver.GetHashCode().ToString()); var mainMenu = new MainMenu(_driver); var formMenu = new SubMenuForms(_driver); var formPages = new FormPages(_driver); Console.WriteLine("Attemping to delete form with ID {0}", formId); // navigate to Forms > Design Forms and Packets > Edit Forms _driver.SwitchToDefaultFrame(); mainMenu.ClickMainMenuTab(); mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickEditForms(); _test.Log(LogStatus.Pass, "Navigate to Forms > Design Forms and Packets > Edit Forms"); // select the form in the list _driver.SwitchToFrameById("MainContentsIFrame"); formPages.EditFormsPage.SelectForm(formId); _test.Log(LogStatus.Pass, "Select the form in the list"); // delete the form _driver.SwitchToDefaultFrame(); formMenu.ClickDeleteForms(); formPages.EditFormsPage.ConfirmDeletion(); _test.Log(LogStatus.Pass, "Delete and confirm"); }
/// <summary> /// Create a new, blank, form for testing purposes. To use, assign this function to a string. /// </summary> /// <returns>The ID of the newly created form.</returns> public int CreateForm() { var formData = new FormData(); var mainMenu = new MainMenu(_driver); var formMenu = new SubMenuForms(_driver); var formPages = new FormPages(_driver); // navigate to Forms > Design Forms and Packets > Create New Form _driver.SwitchToDefaultFrame(); mainMenu.ClickMainMenuTab(); mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickCreateNewForm(); _test.Log(LogStatus.Pass, "Navigate to Forms > Design Forms and Packets > Create New Form"); // click 'A blank form' _driver.SwitchToFrameById("MainContentsIFrame"); formPages.CreateNewFormPage.ClickBlankForm(); _test.Log(LogStatus.Pass, "Click 'A blank form'"); // enter form info _driver.SwitchToFrameById("tabs_Panel"); formPages.EditAndCreateFormPage.PropertiesTab.ClickStandardFormRadioButton(); formPages.EditAndCreateFormPage.PropertiesTab.FillOutFormTitle(formData.FormTitle); _test.Log(LogStatus.Pass, "Enter form information"); // save _driver.SwitchToDefaultFrame(); _driver.SwitchToFrameById("MainContentsIFrame"); formPages.EditAndCreateFormPage.ClickSaveButton(); _test.Log(LogStatus.Pass, "Save the form"); return(formPages.EditAndCreateFormPage.GetFormId()); }
public void Form_Create_New_Blank() { Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString()); var formData = new FormData(); var mainMenu = new MainMenu(Driver); var formMenu = new SubMenuForms(Driver); var formPages = new FormPages(Driver); var formWorkflow = new FormWorkflows(Driver, test); try //Contains Contents of Test { //test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]); // navigate to Forms > Design Forms and Packets > Create New Form mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickCreateNewForm(); test.Log(LogStatus.Pass, "Navigate to Forms > Design Forms and Packets > Create New Form"); // click 'A blank form' Driver.SwitchToFrameById("MainContentsIFrame"); formPages.CreateNewFormPage.ClickBlankForm(); test.Log(LogStatus.Pass, "Click 'A blank form'"); // enter form info Driver.SwitchToFrameById("tabs_Panel"); formPages.EditAndCreateFormPage.PropertiesTab.ClickStandardFormRadioButton(); test.Log(LogStatus.Pass, "Select the 'Standard Form' radio button"); formPages.EditAndCreateFormPage.PropertiesTab.FillOutFormTitle(formData.FormTitle); test.Log(LogStatus.Pass, "Fill out the form title"); // save Driver.SwitchToDefaultFrame(); Driver.SwitchToFrameById("MainContentsIFrame"); formPages.EditAndCreateFormPage.ClickSaveButton(); test.Log(LogStatus.Pass, "Click the save button"); var formId = formPages.EditAndCreateFormPage.GetFormId(); Console.WriteLine("Form ID: {0}", formId); // verify that the form was created Driver.SwitchToDefaultFrame(); mainMenu.ClickMainMenuTab(); mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickEditForms(); Driver.SwitchToFrameById("MainContentsIFrame"); Assert.IsTrue(formPages.EditFormsPage.FormExists(formId)); test.Log(LogStatus.Pass, "Verify the form exists"); // delete the form formWorkflow.DeleteForm(formId); test.Log(LogStatus.Pass, "Delete the form"); } catch (Exception e) //On Error Do { HandleException(e, Driver); throw; } }