public void SpecialServiceUploadTest() { WebDriverWait Wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20)); DataRow customerRow = dbAccess.GetRandomSyncedCustomerRow(); DataRow carrierRow = dbAccess.GetRandomSyncedCarrierRow(); string customerId = customerRow["CustomerId"].ToString(); string carrierId = carrierRow["CarrierId"].ToString(); SettingsPage settingsPageElements = new SettingsPage(); settingsPageElements.ClickCustomerSettingsGeneralLink() .SearchAndSelectCustomer(customerId) .SetCustomerGeneralFields() .SetTimeZone("(GMT -6:00) Central Time (US & Canada), Mexico City") .ClickSaveButton() .WaitForSaveConfirmation() .Refresh(); PricingUploadPage pricingUploadPage = new PricingUploadPage(); pricingUploadPage .UploadSpecialServices(customerId, carrierId); Assert.That(pricingUploadPage.UploadSuccessfulMessage.Displayed, Is.True, "'Upload successful' message is missing\n"); string expectedLastUpdated = DateTime.Now.ToString("MM-dd-yy HH:mm"); Wait.Until(d => pricingUploadPage.ClearSpecialServicesButton.Enabled); string actualLastUpdated = pricingUploadPage.ServicesLastUpdated.Text.Replace("Last Updated: ", ""); //Assert.That((DateTime.Parse(expectedLastUpdated) - DateTime.Parse(actualLastUpdated)).TotalMinutes, // Is.LessThanOrEqualTo(1), "Last Updated time is not within the last minute\n"); pricingUploadPage .ClearSpecialServicesButton.Click(); Assert.True(Wait.Until(d => !pricingUploadPage.ClearSpecialServicesButton.Enabled)); }
public void RateUploadTest() { DataRow customerRow = dbAccess.GetRandomSyncedCustomerRow(); DataRow carrierRow = dbAccess.GetRandomSyncedCarrierRow(); string customerId = customerRow["CustomerId"].ToString(); string carrierId = carrierRow["CarrierId"].ToString(); SettingsPage settingsPageElements = new SettingsPage(); settingsPageElements.ClickCustomerSettingsGeneralLink() .SearchAndSelectCustomer(customerId) .SetCustomerGeneralFields() .SetTimeZone("(GMT -6:00) Central Time (US & Canada), Mexico City") .ClickSaveButton() .WaitForSaveConfirmation() .Refresh(); PricingUploadPage pricingUploadPage = new PricingUploadPage(); string expectedLineHaulName = "Test" + DateTime.Now.ToString("yyyyMMddHHmmssfff"); pricingUploadPage.UploadLineHaulRates(customerId, carrierId, expectedLineHaulName); string expectedLastUpdated = DateTime.Now.ToString("MM-dd-yy HH:mm"); string actualLastUpdated = pricingUploadPage.LineHaulLastUpdated.Text.Replace("Last Updated: ", ""); string actualLineHaulName = pricingUploadPage.LineHaulSchedulesFieldOptions[0].Text; Assert.AreEqual(expectedLineHaulName, actualLineHaulName); //Assert.That((DateTime.Parse(expectedLastUpdated) - DateTime.Parse(actualLastUpdated)).TotalMinutes, // Is.LessThanOrEqualTo(1), "Last Updated time is not within the last minute\n"); Assert.That(pricingUploadPage.UploadSuccessfulMessage.Displayed, Is.True, "'Upload successful' message is missing\n"); }
public void CustomerSettingsFindCustomerByENumber() { SettingsPage settingsPage = new SettingsPage(); DataRow customerRow = dbAccess.GetRandomSyncedCustomerRow(); string customerId = customerRow["CustomerId"].ToString(); settingsPage.ClickCustomerSettingsGeneralLink() .SearchCustomer(customerId); Assert.IsTrue(settingsPage.DisplayedInResults(settingsPage.CustomerIdSearchResults, customerId), "Customer search results do not contain " + customerId); }
public void CustomerSettingsFindCustomerByName() { SettingsPage settingsPage = new SettingsPage(); DataRow customerRow = dbAccess.GetRandomSyncedCustomerRow(); string customerName = customerRow["CustomerName"].ToString(); settingsPage.ClickCustomerSettingsGeneralLink() .SearchCustomer(customerName); //settingsPageElements.SearchCustomer(Regex.Replace(customerName.Split()[0], @"[^0-9a-zA-Z\ ]+", "")); Assert.IsTrue(settingsPage.DisplayedInResults(settingsPage.CustomerNameSearchResults, customerName), "Customer search results do not contain " + customerName); }
public void CustomerSettingsCogsSellSideActive() { SettingsPage settingsPage = new SettingsPage(); DataRow customerRow = dbAccess.GetUnsyncedCustomerRow(); string customerId = customerRow["CustomerId"].ToString(); settingsPage.ClickCustomerSettingsGeneralLink() .SearchCustomer(customerId); Assert.AreEqual(settingsPage.CustomerIdSearchResults[0].Text, "No customers found"); Pages.Optimizer.AccountsPage optimizerAccountsPageElements = new Pages.Optimizer.AccountsPage(); optimizerAccountsPageElements.SyncCustomerWithTlrg(customerId); settingsPage = new SettingsPage() .Refresh() .ClickCustomerSettingsGeneralLink() .SearchAndSelectCustomer(customerId); Assert.That(settingsPage.CogsActiveSellSideCheck.Displayed, Is.True); }
public void CustomerSettingsSyncNewCustomer() { SettingsPage settingsPage = new SettingsPage(); DataRow customerRow = dbAccess.GetUnsyncedCustomerRow(); string customerId = customerRow["CustomerId"].ToString(); settingsPage.ClickCustomerSettingsGeneralLink() .SearchCustomer(customerId); Assert.AreEqual(settingsPage.CustomerIdSearchResults[0].Text, "No customers found"); Pages.Optimizer.AccountsPage optimizerAccountsPageElements = new Pages.Optimizer.AccountsPage(); optimizerAccountsPageElements.SyncCustomerWithTlrg(customerId); settingsPage = new SettingsPage(); customerRow = dbAccess.GetSyncedCustomerRow(customerId); string isTlrgEnabled = customerRow["IsTLRGEnabled"].ToString(); Assert.IsTrue(Convert.ToBoolean(isTlrgEnabled)); settingsPage.Refresh() .ClickCustomerSettingsGeneralLink() .SearchCustomer(customerId); Assert.AreEqual(settingsPage.CustomerIdSearchResults[0].Text, customerId); }