public void ChangeAuditsFilePath_ThenSave_PersistsChanges_UITest()
        {
            var DataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData, Environment.SpecialFolderOption.Create), "Warewolf");

            var defaultPath = Path.Combine(DataPath, @"Audits");
            var changedPath = Path.Combine(DataPath, @"NewAudits");

            if (!Directory.Exists(changedPath))
            {
                Directory.CreateDirectory(changedPath);
                Assert.IsTrue(Directory.Exists(changedPath));
            }

            UIMap.Click_ConfigureSetting_From_Menu();
            SettingsUIMap.Select_LoggingTab();
            SettingsUIMap.Assert_Audits_File_Path(defaultPath);
            SettingsUIMap.Update_Audits_File_Path(changedPath);
            UIMap.Click_Save_RibbonButton();
            SettingsUIMap.Click_Close_Settings_Tab_Button();
            UIMap.Click_ConfigureSetting_From_Menu();
            SettingsUIMap.Select_LoggingTab();
            // ASSERT CHANGE HAPPENED AFTER CLOSING THE SETTINGS TAB
            SettingsUIMap.Assert_Audits_File_Path(changedPath);
            // RESET TO DEFAULT
            SettingsUIMap.Update_Audits_File_Path(defaultPath);
            UIMap.Click_Save_RibbonButton();

            if (Directory.Exists(changedPath))
            {
                Directory.Delete(changedPath);
                Assert.IsFalse(Directory.Exists(changedPath));
            }
        }
 private void GivenAuditsFilePathIsDefaultValue(string defaultPath)
 {
     // RESET TO DEFAULT
     UIMap.Click_ConfigureSetting_From_Menu();
     SettingsUIMap.Select_LoggingTab();
     SettingsUIMap.Update_Audits_File_Path(defaultPath);
     UIMap.Click_Save_RibbonButton();
     SettingsUIMap.Click_Close_Settings_Tab_Button();
 }
        public void ChangeAuditsFilePath_ThenSave_PersistsChanges_UITest()
        {
            //Prepare for test
            var DataPath    = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData, Environment.SpecialFolderOption.Create), "Warewolf");
            var defaultPath = Path.Combine(DataPath, @"Audits");
            var changedPath = Path.Combine(DataPath, @"NewAudits");

            GivenAuditsFilePathIsDefaultValue(defaultPath);
            GivenDirectoryExistsAndIsEmpty(changedPath);

            //Execute test
            UIMap.Click_ConfigureSetting_From_Menu();
            SettingsUIMap.Select_LoggingTab();
            SettingsUIMap.Assert_Audits_File_Path(defaultPath);
            SettingsUIMap.Update_Audits_File_Path(changedPath);
            UIMap.Click_Save_RibbonButton();
            SettingsUIMap.Click_Close_Settings_Tab_Button();

            //Assert
            UIMap.Click_ConfigureSetting_From_Menu();
            SettingsUIMap.Select_LoggingTab();
            SettingsUIMap.Assert_Audits_File_Path(changedPath);
        }