public void Run(string manifestPath, CdsConnection cdsConnection) { // TODO - throw good errors if manifest can't be found/read/isInvalid var manifest = SerialisationWrapper.DeserialiseFromFile <ConfigurationManifest>(manifestPath); // TODO - throw good error if XrmClient is unauthorised/etc... var client = XrmClient.GetCrmServiceClientFromManifestConfiguration(manifest.CdsConnection); ValidateManifest(manifest); if (!ValidationResult.IsValid) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Manifest is not valid. Not progressing with registration"); Console.WriteLine($"\nErrors found in manifest validation:\n{ValidationResult}"); Console.ResetColor(); // QUESTION - Do you really want to throw an exception here, if you're already logging the val output? throw new InvalidManifestException("Exiting processing with exception - Manifest is not valid"); } if (manifest.LoggingConfiguration == null) { manifest.LoggingConfiguration = new LoggingConfiguration() { LoggerConfigurationType = LoggerConfigurationType.Console, LogLevelToTrace = LogLevel.Information }; } var configWrapper = new ConfigurationWrapper(); configWrapper.GenerateCustomisations(manifest, client); }
public virtual void TestFixtureSetUp() { DomainObjectsConfiguration.SetCurrent(TestMappingConfiguration.Instance.GetDomainObjectsConfiguration()); MappingConfiguration.SetCurrent(TestMappingConfiguration.Instance.GetMappingConfiguration()); ConfigurationWrapper.SetCurrent(null); FakeMappingConfiguration.Reset(); }
public ConfigurationProvider( ConfigurationWrapper configuration, SegmentConfiguration segmentConfiguration) { this.configuration = configuration; this.segmentConfiguration = segmentConfiguration; }
//This tests uses the app.config value to pick a manager and change SP to use that salesperson to login. It then checks user has landed on a manager version of the dashboard page. public void ChangeUserToAManagerTest() { //Setup reporting for this test ExtentTest test = MyDriverManager.report.CreateTest("ChangeUserToAManagerTest"); //Setup Page(s) NewDashboardPage theDashboardPage = new NewDashboardPage(MyDriverManager.driver); NewManagerDashboardPage theManagerDashboardPage = new NewManagerDashboardPage(MyDriverManager.driver); //Go to the the initial page MyDriverManager.goToDashboardPage(); theDashboardPage.waitForDashboardPageToLoad(); //Set User theDashboardPage.clickOnUserCircle(); theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.ManagerUserName()); theDashboardPage.clickOnChangeTheUserBtn(); //Check we are on manager version of Dashboard theManagerDashboardPage.waitForPageToLoad(); //Set reporting info test.Pass("User successfully changed to manager"); test.Log(Status.Pass, "ChangeUserToAManagerTest passed"); }
public CompanySettingsWebServicesView(ConfigurationWrapper config) { _companySettings = config.CompanySettings; InitializeComponent(); BindingContext = _companySettings.WebServices; }
public override void TestFixtureSetUp() { base.TestFixtureSetUp(); DomainObjectsConfiguration.SetCurrent(TableInheritanceConfiguration.Instance.GetDomainObjectsConfiguration()); MappingConfiguration.SetCurrent(StandardConfiguration.Instance.GetMappingConfiguration()); ConfigurationWrapper.SetCurrent(null); }
public NewCompanyViewModel(ConfigurationWrapper config, DatabaseService ds) : base() { _config = config; CompanySettings = config.CompanySettings; _databaseService = ds; NewCompanyCommand = new Command(CreateNewCompany); }
public static async Task Main(string[] args) { var config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", true) .AddEnvironmentVariables() .Build(); var configWrapper = new ConfigurationWrapper(config); var topClipsModuleHelper = new TopClipsModuleHelper(configWrapper); var botHelper = new BotHelper(configWrapper); using (var functionWrapper = new FunctionWrapper(configWrapper)) using (var discordWrapper = new DiscordWrapper(configWrapper["BotToken"])) using (var services = new ServiceCollection() .AddSingleton <IDiscordWrapper>(discordWrapper) .AddSingleton <IConfigurationWrapper>(configWrapper) .AddSingleton <IFunctionWrapper>(functionWrapper) .AddSingleton <ITopClipsModuleHelper>(topClipsModuleHelper) .AddSingleton <IBotHelper>(botHelper) .AddLogging(s => s.AddConsole()) .BuildServiceProvider()) { var bot = new Bot(services); await bot.RunAsync(); await Task.Delay(-1); } }
public override void SetUp() { base.SetUp(); DomainObjectsConfiguration.SetCurrent(TableInheritanceConfiguration.Instance.GetDomainObjectsConfiguration()); MappingConfiguration.SetCurrent(TableInheritanceConfiguration.Instance.GetMappingConfiguration()); ConfigurationWrapper.SetCurrent(null); _transactionScope = ClientTransaction.CreateRootTransaction().EnterDiscardingScope(); }
public JsonConfigurationProvider(string path) { if (File.Exists(path)) { string serializedConfiguration = File.ReadAllText(path); _configurationWrapper = JsonConvert.DeserializeObject <ConfigurationWrapper <T> >(serializedConfiguration); } }
public override void SetUp() { base.SetUp(); DomainObjectsConfiguration.SetCurrent(StandardConfiguration.Instance.GetDomainObjectsConfiguration()); MappingConfiguration.SetCurrent(StandardConfiguration.Instance.GetMappingConfiguration()); ConfigurationWrapper.SetCurrent(null); }
public override void TestFixtureTearDown() { DomainObjectsConfiguration.SetCurrent(null); MappingConfiguration.SetCurrent(null); ConfigurationWrapper.SetCurrent(null); base.TestFixtureTearDown(); }
public ModuleStarter(IConfiguration configuration) { _configurationWrapper = new ConfigurationWrapper(configuration); foreach (var child in configuration.GetSection("DisabledModules:App").GetChildren()) { _ignoredAppModules.Add(child.Value); } }
public void setConfiguration(string newConfigurationPath) { if (string.IsNullOrEmpty(newConfigurationPath)) { return; } configurationFilePath = newConfigurationPath; providerConfiguration = ConfigurationManager.readConfiguration(configurationFilePath); setName(providerConfiguration.getSingleStringProperty(ProviderProperties.PROVIDER_NAME_KEY)); }
public void SetupAll() { var config = new ConfigurationWrapper(); var authenticationRepository = new AuthenticationRepository(new RestClient(config.GetEnvironmentVarAsString("MP_OAUTH_BASE_URL")), new RestClient(config.GetEnvironmentVarAsString("MP_REST_API_ENDPOINT"))); var apiUserRepository = new ApiUserRepository(config, authenticationRepository); _authToken = apiUserRepository.GetToken(); }
public ManifestValidationResult ValidateManifest(ICustomisationManifest manifest) { var configurationManifest = (ConfigurationManifest)manifest; var wrapper = new ConfigurationWrapper(); ValidationResult = wrapper.Validate(configurationManifest); return(ValidationResult); }
public void ConstructorTest() { FileInfo _configurationFileInfor = new FileInfo(ConfigurationPath); Mock <IConfiguration> _iConfigurationMock = new Mock <IConfiguration>(); Mock <IGraphicalUserInterface> _iGraphicalUserInterface = new Mock <IGraphicalUserInterface>(); ConfigurationWrapper _underTestItem = new ConfigurationWrapper(_configurationFileInfor, _iConfigurationMock.Object, _iGraphicalUserInterface.Object); Assert.AreSame(_configurationFileInfor, _underTestItem.ConfigurationFile); Assert.AreEqual <string>(ConfigurationPath, _underTestItem.ConfigurationFile.FullName); }
public void SetUp() { _configuration = new StorageConfiguration(); _sqlStorageObjectFactory = new SqlStorageObjectFactory(); FakeConfigurationWrapper configurationWrapper = new FakeConfigurationWrapper(); configurationWrapper.SetUpConnectionString("Rdbms", "ConnectionString", null); ConfigurationWrapper.SetCurrent(configurationWrapper); }
public override void SetUp() { base.SetUp(); _sqlStorageObjectFactory = new SqlStorageObjectFactory(); _definition = new RdbmsProviderDefinition("StorageProviderID", _sqlStorageObjectFactory, "ConnectionString"); FakeConfigurationWrapper configurationWrapper = new FakeConfigurationWrapper(); configurationWrapper.SetUpConnectionString("SqlProvider", "ConnectionString", null); ConfigurationWrapper.SetCurrent(configurationWrapper); }
public HomeView(ConfigurationWrapper config, INavigationService navigationService) { InitializeComponent(); AppLogo.Source = FileLocatorService.DeviceSpecificFileLocation("nucleus_invoice_320.png"); Icon = FileLocatorService.DeviceSpecificFileLocation("icons8_Home_64px.png"); if (config.AppSettings.CurrentCompany.Name == null) { navigationService.PushModalAsync(typeof(NewCompanyViewModel), null); } }
public static async Task Run([TimerTrigger("%PostClipsFunctionCron%")] TimerInfo myTimer, ILogger log) { var config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("local.settings.json", true) .AddEnvironmentVariables() .Build(); var configWrapper = new ConfigurationWrapper(config); //TODO use config wrapper var topClipsEndpoint = Environment.GetEnvironmentVariable("TwitchTopClipsEndpoint"); var clientId = Environment.GetEnvironmentVariable("TwitchClientId"); var accept = Environment.GetEnvironmentVariable("TwitchAcceptHeaderValue"); var botToken = Environment.GetEnvironmentVariable("BotToken"); var connectionString = Environment.GetEnvironmentVariable("TopTwitchClipBotConnectionString"); var enableNumberOfClipsPerDay = bool.Parse(Environment.GetEnvironmentVariable("EnableNumberOfClipsPerDay")); var clipOrderMappings = configWrapper.Get <List <ClipOrderMapping> >("ClipOrderMappings"); var now = DateTime.UtcNow; var yesterday = now.AddDays(-1); var logWrapper = new LoggerWrapper(log); using (var twitchWrapper = new TwitchWrapper()) using (var discordWrapper = new DiscordWrapper(botToken)) using (var context = new TopTwitchClipBotContext(connectionString)) { var helper = new PostClipsHelper(logWrapper, context, twitchWrapper, discordWrapper); logWrapper.LogInformation("Posting clips."); await discordWrapper.LogInAsync(); var containers = await context.GetPendingChannelConfigsAsync(now.Hour); var afterTimeBetweenClipsContainers = helper.AfterTimeBetweenClips(containers, now); var readyToPostContainers = helper.ReadyToPostContainers(afterTimeBetweenClipsContainers, yesterday, enableNumberOfClipsPerDay); var pendingClipContainers = await helper.BuildClipContainers(topClipsEndpoint, clientId, accept, readyToPostContainers); var clipsWithMinViews = helper.ClipsWithMinViews(pendingClipContainers); var unseenClipContainers = helper.BuildUnseenClipContainers(clipsWithMinViews); var results = helper.AtATimeContainers(unseenClipContainers, clipOrderMappings); var unseenClips = results.SelectMany(s => s.UnseenClips).ToList(); await helper.InsertHistories(unseenClips); var channelContainers = await helper.BuildChannelContainers(results); foreach (var channelContainer in channelContainers) { await helper.SendMessagesAsync(channelContainer); } await discordWrapper.LogOutAsync(); logWrapper.LogInformation("Posted clips."); } }
public static int SendMail(EmailContracts objEmailContracts) { var _objMailMessage = new MailMessage(); try { if (objEmailContracts != null) { if (string.IsNullOrEmpty(objEmailContracts.emailFrom)) { return(2); } if (string.IsNullOrEmpty(objEmailContracts.emailTo)) { return(3); } var _mailAddress = new MailAddress(objEmailContracts.emailFrom); _objMailMessage.From = _mailAddress; _objMailMessage.To.Add(objEmailContracts.emailTo); if (!string.IsNullOrEmpty(objEmailContracts.emailCc)) { _objMailMessage.CC.Add(objEmailContracts.emailCc); } if (!string.IsNullOrEmpty(objEmailContracts.emailBcc)) { _objMailMessage.Bcc.Add(objEmailContracts.emailBcc); } _objMailMessage.Subject = !string.IsNullOrEmpty(objEmailContracts.emailSubject) ? objEmailContracts.emailSubject : "No Subject"; _objMailMessage.Body = !string.IsNullOrEmpty(objEmailContracts.emailBody) ? objEmailContracts.emailBody : "N/A"; if (objEmailContracts.hasAttachement) { var _attachement = new Attachment(new MemoryStream(objEmailContracts.attachement), objEmailContracts.attachmentName, objEmailContracts.attachmentType); _objMailMessage.Attachments.Add(_attachement); } _objMailMessage.IsBodyHtml = objEmailContracts.isBodyHtml; var smtpclientDetails = new SmtpClient(ConfigurationWrapper.StringSettings(ConfigKey.SmtpHost)); var netWorkCredential = new NetworkCredential(ConfigurationWrapper.StringSettings(ConfigKey.SmtpUserName), ConfigurationWrapper.StringSettings(ConfigKey.SmtpPassword)); smtpclientDetails.Port = ConfigurationWrapper.IntegerSettings(ConfigKey.SmtpPort); smtpclientDetails.Credentials = netWorkCredential; smtpclientDetails.SendAsync(_objMailMessage, string.Format("lms_{0}", DateTime.Now.ToString("MM-dd-yyyy"))); } return(1); } catch { return(0); } }
//This test creates a self-approved licence and returns user to dashboard public void CreateAwaitingApprovalSkillsLicenceTest() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.userCircle(driver).Click(); DashboardPage.changeUserFreeTextBox(driver).SendKeys(ConfigurationWrapper.SalspersonUserName()); DashboardPage.changeTheUserButton(driver).Click(); string actualValue1 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SKILLS LICENCES"), actualValue1 + " doesn't contain 'SKILLS LICENCES'"); string actualValue2 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue2.Contains("SKILLS LICENCES"), actualValue2 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.createSkillsLicenceButton(driver).Click(); string actualValue3 = GetMyCustomersPage.getTextForHeader(driver); Assert.IsTrue(actualValue3.Contains("SELECT COMPANY"), actualValue3 + " doesn't contain 'SELECT COMPANY'"); GetMyCustomersPage.customerSearchBox(driver).SendKeys("TEST QC CUSTOMER"); GetMyCustomersPage.customerSelect(driver).Click(); string actualValue4 = GetMyCustomerContactsPage.getTextForHeader(driver); Assert.IsTrue(actualValue4.Contains("SELECT CONTACT"), actualValue4 + " doesn't contain 'SELECT CONTACT'"); GetMyCustomerContactsPage.delegateButton(driver).Click(); GetMyCustomerContactsPage.contactSelect(driver).Click(); string actualValue5 = GetMylicencesPage.getTextForHeader(driver); Assert.IsTrue(actualValue5.Contains("SELECT TEMPLATE"), actualValue5 + " doesn't contain 'SELECT TEMPLATE'"); GetMylicencesPage.blankTemplate(driver).Click(); string actualValue6 = AlterSkillsLicencePage.getTextForHeader(driver); Assert.IsTrue(actualValue6.Contains("IN DRAFT"), actualValue6 + " doesn't contain 'IN DRAFT'"); AlterSkillsLicencePage.quoteATextBox(driver).SendKeys("5555.55"); AlterSkillsLicencePage.itPracticeSelect(driver).Click(); AlterSkillsLicencePage.itAllVendors(driver).Click(); AlterSkillsLicencePage.agileAndScrumPremium(driver).Click(); AlterSkillsLicencePage.QuoteADiscountBox(driver).Click(); AlterSkillsLicencePage.QuoteADiscountBox(driver).SendKeys("99"); AlterSkillsLicencePage.QuoteADiscountBox(driver).SendKeys(Keys.Tab); string actualValue7 = AlterSkillsLicencePage.getHierarchyWarning(driver); Assert.IsTrue(actualValue7.Contains("Over Sales Director"), actualValue7 + " doesn't contain 'Over Sales Director'"); AlterSkillsLicencePage.clickOnSaveAndSendButton(driver); string actualvalue8 = ManagerApprovalPage.getTextForHeader(driver); Assert.IsTrue(actualvalue8.Contains("MANAGER APPROVAL"), actualvalue8 + " doesn't contain 'MANAGER APPROVAL'"); ManagerApprovalPage.clickOnManagerNameTickbox(driver); ManagerApprovalPage.clickOnSendToManagerButton(driver); string actualvalue9 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualvalue9.Contains("SKILLS LICENCES"), actualvalue9 + " doesn't contain 'SKILLS LICENCES'"); } }
public void SaveTest() { FileInfo _fileInforFixture = new FileInfo(ConfigurationPath); Mock <IConfiguration> _iConfigurationMock = new Mock <IConfiguration>(); _iConfigurationMock.Setup(x => x.SaveConfiguration(It.IsAny <string>(), _fileInforFixture)); Mock <IGraphicalUserInterface> _iGraphicalUserInterface = new Mock <IGraphicalUserInterface>(); ConfigurationWrapper _underTestItem = new ConfigurationWrapper(_fileInforFixture, _iConfigurationMock.Object, _iGraphicalUserInterface.Object); Assert.AreEqual <string>(ConfigurationPath, _underTestItem.ConfigurationFile.FullName); _underTestItem.Save("wrong_path"); _iConfigurationMock.Verify(x => x.SaveConfiguration("wrong_path", _fileInforFixture), Times.Once); Assert.AreEqual <string>(ConfigurationPath, _underTestItem.ConfigurationFile.FullName); }
public virtual void SetUp() { DomainObjectsConfiguration.SetCurrent(TestMappingConfiguration.Instance.GetDomainObjectsConfiguration()); MappingConfiguration.SetCurrent(TestMappingConfiguration.Instance.GetMappingConfiguration()); ConfigurationWrapper.SetCurrent(null); ClassIDProviderStub = MockRepository.GenerateStub <IClassIDProvider>(); DomainModelConstraintProviderStub = MockRepository.GenerateStub <IDomainModelConstraintProvider>(); DomainObjectCreatorStub = MockRepository.GenerateStub <IDomainObjectCreator>(); PropertyMetadataProvider = new PropertyMetadataReflector(); MappingObjectFactory = new ReflectionBasedMappingObjectFactory( Configuration.NameResolver, ClassIDProviderStub, PropertyMetadataProvider, DomainModelConstraintProviderStub, DomainObjectCreatorStub); }
//This test creates a self-approved licence and returns user to dashboard public void CreateApprovedButSuspendedSkillsLicenceSmokeTest() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.userCircle(driver).Click(); DashboardPage.changeUserFreeTextBox(driver).SendKeys(ConfigurationWrapper.SalspersonUserName()); DashboardPage.changeTheUserButton(driver).Click(); string actualValue1 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); string actualValue2 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue2.Contains("SKILLS LICENCES"), actualValue2 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.createSkillsLicenceButton(driver).Click(); string actualValue3 = GetMyCustomersPage.getTextForHeader(driver); Assert.IsTrue(actualValue3.Contains("SELECT COMPANY"), actualValue3 + " doesn't contain 'SELECT COMPANY'"); GetMyCustomersPage.customerSearchBox(driver).SendKeys("TEST QC CUSTOMER"); GetMyCustomersPage.customerSelect(driver).Click(); string actualValue4 = GetMyCustomerContactsPage.getTextForHeader(driver); Assert.IsTrue(actualValue4.Contains("SELECT CONTACT"), actualValue4 + " doesn't contain 'SELECT CONTACT'"); GetMyCustomerContactsPage.delegateButton(driver).Click(); GetMyCustomerContactsPage.contactSelect(driver).Click(); string actualValue5 = GetMylicencesPage.getTextForHeader(driver); Assert.IsTrue(actualValue5.Contains("SELECT TEMPLATE"), actualValue5 + " doesn't contain 'SELECT TEMPLATE'"); GetMylicencesPage.blankTemplate(driver).Click(); string actualValue6 = AlterSkillsLicencePage.getTextForHeader(driver); Assert.IsTrue(actualValue6.Contains("IN DRAFT"), actualValue6 + " doesn't contain 'IN DRAFT'"); AlterSkillsLicencePage.quoteATextBox(driver).SendKeys("3333.33"); AlterSkillsLicencePage.itPracticeSelect(driver).Click(); AlterSkillsLicencePage.itAllVendors(driver).Click(); AlterSkillsLicencePage.agileAndScrumPremium(driver).Click(); AlterSkillsLicencePage.clickOnSaveAndSendButton(driver); string actualvalue7 = CustomerApprovalPage.getTextForHeader(driver); Assert.IsTrue(actualvalue7.Contains("SEND SKILLS LICENCE TO CUSTOMER"), actualvalue7 + " doesn't contain 'Skills Licence To Customer'"); HeaderPage.quotationsMenuOption(driver).Click(); HeaderPage.salesPortalMenuOption(driver).Click(); string actualvalue8 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualvalue8.Contains("SKILLS LICENCES"), actualvalue8 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.approved(driver).Click(); DashboardWithMeApprovedPage.clickSuspendApprovedLicence(driver).Click(); string actualvalue9 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualvalue9.Contains("SKILLS LICENCES"), actualvalue9 + " doesn't contain 'SKILLS LICENCES'"); } }
//This tests uses the app.config value to pick a salesperson and change SP to use that salesperson to login public void ChangeUserToAStandardUserTest() { //Setup Page(s) NewDashboardPage theDashboardPage = new NewDashboardPage(MyDriverManager.driver); //Go to the the intial page MyDriverManager.goToDashboardPage(); theDashboardPage.waitForDashboardPageToLoad(); //Set User theDashboardPage.clickOnUserCircle(); theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName()); theDashboardPage.clickOnChangeTheUserBtn(); theDashboardPage.waitForDashboardPageToLoad(); }
//This test clicks dashboard approved then hit save into baps area, select quote A and save into BAPS. Checks user returned to dashboard. public void SendApprovedQuotesViaBAPS() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.userCircle(driver).Click(); DashboardPage.changeUserFreeTextBox(driver).SendKeys(ConfigurationWrapper.SalspersonUserName()); DashboardPage.changeTheUserButton(driver).Click(); string actualValue1 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); string actualValue2 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue2.Contains("SKILLS LICENCES"), actualValue2 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.createSkillsLicenceButton(driver).Click(); string actualValue3 = GetMyCustomersPage.getTextForHeader(driver); Assert.IsTrue(actualValue3.Contains("SELECT COMPANY"), actualValue3 + " doesn't contain 'SELECT COMPANY'"); GetMyCustomersPage.customerSearchBox(driver).SendKeys("TEST QC CUSTOMER"); GetMyCustomersPage.customerSelect(driver).Click(); string actualValue4 = GetMyCustomerContactsPage.getTextForHeader(driver); Assert.IsTrue(actualValue4.Contains("SELECT CONTACT"), actualValue4 + " doesn't contain 'SELECT CONTACT'"); GetMyCustomerContactsPage.delegateButton(driver).Click(); GetMyCustomerContactsPage.contactSelect(driver).Click(); string actualValue5 = GetMylicencesPage.getTextForHeader(driver); Assert.IsTrue(actualValue5.Contains("SELECT TEMPLATE"), actualValue5 + " doesn't contain 'SELECT TEMPLATE'"); GetMylicencesPage.blankTemplate(driver).Click(); string actualValue6 = AlterSkillsLicencePage.getTextForHeader(driver); Assert.IsTrue(actualValue6.Contains("IN DRAFT"), actualValue6 + " doesn't contain 'IN DRAFT'"); AlterSkillsLicencePage.quoteATextBox(driver).SendKeys("2222.22"); AlterSkillsLicencePage.itPracticeSelect(driver).Click(); AlterSkillsLicencePage.itAllVendors(driver).Click(); AlterSkillsLicencePage.agileAndScrumPremium(driver).Click(); AlterSkillsLicencePage.clickOnSaveAndSendButton(driver); string actualvalue7 = CustomerApprovalPage.getTextForHeader(driver); Assert.IsTrue(actualvalue7.Contains("SEND SKILLS LICENCE TO CUSTOMER"), actualvalue7 + " doesn't contain 'Skills Licence To Customer'"); CustomerApprovalPage.getBAPSSection(driver).Click(); string subHeadingText = CustomerApprovalPage.getTextForBAPSSubHeading(driver); Assert.IsTrue(subHeadingText.Contains("BAPS"), subHeadingText + "doesn't contain 'BAPS'"); CustomerApprovalPage.selectQuoteA(driver).Click(); CustomerApprovalPage.selectCreateButton(driver).Click(); string dashboardHeader = DashboardPage.getTextForHeader(driver); Assert.IsTrue(dashboardHeader.Contains("SKILLS LICENCES"), dashboardHeader + " doesn't contain 'SKILLS LICENCES'"); } }
public ParseHTMLStrategy(AbstractProvider provider, ConfigurationWrapper someConfiguration) { theProvider = provider; theConfiguration = someConfiguration; setSearchRegExp(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.REGEX_PARSE_SEARCH_RESULTS_KEY)); setSearchResultsUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_RESULTS_URL_KEY)); setSearchUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_URL_KEY)); setSeriesUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SERIES_URL_KEY)); setSearchRemove(theConfiguration.getMultiStringProperty(ParseHTMLStrategyProperties.SEARCH_REMOVE_KEY)); setSearchStart(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_START_KEY)); setSearchEnd(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_END_KEY)); setNotFoundUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.NOT_FOUND_URL_KEY)); setEncoding(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.ENCODING_KEY)); setLanguage(theConfiguration.getEnumProperty <Language>(ParseHTMLStrategyProperties.LANGUAGE_KEY)); setSearchRightToLeft(theConfiguration.getSingleBoolProperty(ParseHTMLStrategyProperties.SEARCH_RIGHT_TO_LEFT_KEY)); setSearchResultsBlacklist(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.REGEX_SEARCH_RESULTS_BLACKLIST_KEY)); setRelationsRemove(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.RELATIONS_REMOVE_KEY)); }
//This tests uses the app.config value to pick a salesperson and change SP to use that salesperson to login public void ChangeUserToAStandardUserTest() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.userCircle(driver).Click(); DashboardPage.changeUserFreeTextBox(driver).SendKeys(ConfigurationWrapper.SalspersonUserName()); DashboardPage.changeTheUserButton(driver).Click(); string actualValue1 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); } }
public ParseHTMLStrategy(AbstractProvider provider, ConfigurationWrapper someConfiguration) { theProvider = provider; theConfiguration = someConfiguration; setSearchRegExp(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.REGEX_PARSE_SEARCH_RESULTS_KEY)); setSearchResultsUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_RESULTS_URL_KEY)); setSearchUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_URL_KEY)); setSeriesUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SERIES_URL_KEY)); setSearchRemove(theConfiguration.getMultiStringProperty(ParseHTMLStrategyProperties.SEARCH_REMOVE_KEY)); setSearchStart(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_START_KEY)); setSearchEnd(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.SEARCH_END_KEY)); setNotFoundUrl(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.NOT_FOUND_URL_KEY)); setEncoding(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.ENCODING_KEY)); setLanguage(theConfiguration.getEnumProperty<Language>(ParseHTMLStrategyProperties.LANGUAGE_KEY)); setSearchRightToLeft(theConfiguration.getSingleBoolProperty(ParseHTMLStrategyProperties.SEARCH_RIGHT_TO_LEFT_KEY)); setSearchResultsBlacklist(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.REGEX_SEARCH_RESULTS_BLACKLIST_KEY)); setRelationsRemove(theConfiguration.getSingleStringProperty(ParseHTMLStrategyProperties.RELATIONS_REMOVE_KEY)); }
public ProductXMLRepository(ConfigurationWrapper configurationWrapper, XMLWrapper xmlWrapper) { _xmlDataProductsFilePath = configurationWrapper.GetSettingValue<string>("XMLDataProductsFilePath"); _xmlWrapper = xmlWrapper; }
/// <summary> /// Writes the <see cref="someConfiguration"/> to the given path. /// </summary> /// <param name="someConfiguration">the configuration to save to disk</param> /// <param name="filepath">Path where config file should be stored to.</param> public static void writeConfiguration(ConfigurationWrapper someConfiguration, string filepath) { if (someConfiguration == null) { return; } StreamWriter fileWriter = null; string tempfilepath = filepath + AppConstants.TEMPFILE_EXTENSION; try { FileStream writeStream = File.Open(tempfilepath, FileMode.Create, FileAccess.ReadWrite); fileWriter = new StreamWriter(writeStream); fileWriter.AutoFlush = true; writePropertyComment(fileWriter, AppPropertyComments.INITIAL_COMMENT_KEY); foreach (string propertyName in someConfiguration.getPropertyNames()) { if (someConfiguration.isSingleValueProperty(propertyName)) { string value = someConfiguration.getSingleStringProperty(propertyName); writeProperty(fileWriter, propertyName, value); continue; } if (someConfiguration.isMultiValueProperty(propertyName)) { List<string> values = someConfiguration.getMultiStringProperty(propertyName); writeMultiValueProperty(fileWriter, propertyName, values); continue; } log.Warn("Configuration property " + propertyName + " not written - non-valid value"); } if (File.Exists(filepath)) { File.Delete(filepath); } fileWriter.Close(); File.Move(tempfilepath, filepath); } catch (Exception ex) { log.Error("Couldn't write configuration to " + filepath + "\nError:\n" + ex.Message); } finally { if (fileWriter != null) { fileWriter.Close(); File.Delete(tempfilepath); } } }
public AppConfigurationWrapper(ConfigurationWrapper someWrappedConfiguration) { wrappedConfiguration = someWrappedConfiguration; }