public void CarrierSettingsUpdateSyncedCarrier() { Boolean ediEnabledBefore; Boolean ediEnabledAfter; string user = env.OptiUser; string pass = env.OptiPassword; SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierWithScacRow(); string carrierId = carrierRow["CarrierId"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId); ediEnabledBefore = settingsPage.EdiEnabled(); Pages.Optimizer.CarrierPage optimizerCarrierPage = new Pages.Optimizer.CarrierPage(); optimizerCarrierPage.SearchAndSelectCarrier(carrierId) .AccessFolder("Company Information") .AccessFolderDraggable("EDI") .ClickCarrierEdiEditButton() .ClickEdi204TLAutoTenderCheckbox() .ClickCarrierEdiSaveButton(); settingsPage = new SettingsPage(); settingsPage.ClickCarrierSettingsGeneralLink() .ClickSyncCarrierToggle() .SetFieldValue(settingsPage.CarrierSyncField, carrierId) .ClickUpdateSyncedCarriersButton() .Refresh() .ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId); ediEnabledAfter = settingsPage.EdiEnabled(); Assert.AreNotEqual(ediEnabledBefore, ediEnabledAfter); }
public void CarrierSettingsFindCarrierByName() { SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomSyncedCarrierRow(); string carrierName = carrierRow["CarrierName"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchCarrier(carrierName); Assert.IsTrue(settingsPage.DisplayedInResults(settingsPage.CarrierNameSearchResults, carrierName), "Carrier search results do not contain " + carrierName); }
public void CarrierSettingsTlrgActive() { SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierRow(); string carrierId = carrierRow["CarrierId"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId); Assert.That(settingsPage.CarrierTlrgActive.Displayed, Is.True); }
public void CarrierSettingsSaveDisabled() { SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierRow(); string carrierId = carrierRow["CarrierId"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId) .SetFieldValue(settingsPage.PrimaryDispatchEmailField, "qa@echo."); Assert.That(settingsPage.SaveButton.Enabled, Is.False); }
public void CarrierSettingsInvalidEmail() { SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierRow(); string carrierId = carrierRow["CarrierId"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId) .SetFieldValue(settingsPage.PrimaryDispatchEmailField, "qa@echo."); Assert.That(settingsPage.InvalidEmailMessage.Displayed, Is.True); }
public void CarrierSettingsScacDisplayed() { SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierRow(); string carrierId = carrierRow["CarrierId"].ToString(); string carrierScac = carrierRow["SCAC"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId); Assert.AreEqual(settingsPage.CarrierScac.GetAttribute("value"), carrierScac); }
public void CarrierSettingsSaveConfirmation() { SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierRow(); string carrierId = carrierRow["CarrierId"].ToString(); string primaryEmailExpected = "qa" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "@echo.com"; settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId) .SetFieldValue(settingsPage.PrimaryDispatchEmailField, primaryEmailExpected) .ClickSaveButton() .WaitForSaveConfirmation(); Assert.That(settingsPage.SaveConfirmationDialog.Displayed, Is.True); }
public void CarrierSettingsCarrierContacts() { SettingsPage settingsPage = new SettingsPage(); DataTable carrierTable = dbAccess.GetRandomCarrierContactRows(); string carrierId = carrierTable.Rows[0]["CarrierId"].ToString(); String firstName = carrierTable.Rows[0]["FirstName"].ToString(); String lastName = carrierTable.Rows[0]["LastName"].ToString(); String phone = carrierTable.Rows[0]["Phone"].ToString(); String email = carrierTable.Rows[0]["Email"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId); Assert.That(settingsPage.DisplayedInCarrierContacts(firstName + lastName + phone + email), Is.True); }
public void CarrierSettingsTertiaryEmail() { SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierRowWithPrimaryEmail(); string carrierId = carrierRow["CarrierId"].ToString(); string tertiaryEmailActual = ""; string tertiaryEmailExpected = "qa" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "@echo.com"; settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId) .SetFieldValue(settingsPage.TertiaryDispatchEmailField, tertiaryEmailExpected) .ClickSaveButton() .Refresh() .ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId); tertiaryEmailActual = settingsPage.GetFieldValue(settingsPage.TertiaryDispatchEmailField); Assert.AreEqual(tertiaryEmailActual, tertiaryEmailExpected); }
public void CarrierSettingsLastUpdated() { string actualUpdate = ""; string expectedUpdate = ""; SettingsPage settingsPage = new SettingsPage(); DataRow carrierRow = dbAccess.GetRandomCarrierRow(); string carrierId = carrierRow["CarrierId"].ToString(); settingsPage.ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId) .SetFieldValue(settingsPage.PrimaryDispatchEmailField, "qa" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "@echo.com") .ClickSaveButton(); expectedUpdate = DateTime.Now.ToString("MM-dd-yy HH:mm"); settingsPage.Refresh() .ClickCarrierSettingsGeneralLink() .SearchAndSelectCarrier(carrierId); actualUpdate = Regex.Match(settingsPage.CarrierLastUpdated.Text, @"\d{2}\-\d{2}\-\d{2} \d{2}\:\d{2}").Value; Assert.That((DateTime.Parse(expectedUpdate) - DateTime.Parse(actualUpdate)).TotalSeconds, Is.LessThanOrEqualTo(5)); }