public void VerifyClearInputHomePageLTL(bool stackable) { GoToGetQuoteLTL(); Assert.AreEqual("Pickup Location Type", Driver.FindElement(optPickupLocationTypeDefault).Text, "Verify Pickup Location Type is set back to default ('Pickup Location Type')"); Assert.AreEqual("United States of America", Driver.FindElement(optPickupCountryDefault).Text.ToString(), "Verify Pickup Country is set back to default ('United States of America')"); Assert.IsEmpty(Driver.FindElement(txtCitySource).Text.ToString(), "Verify Pickup City, State, Zip code is Blank/Empty"); var pckDays = WC.GetWorkingDay(DateTime.Today, 1); var dat = DateTime.Today.AddDays(pckDays).ToString("MM/dd/yyyy"); Assert.AreEqual(dat, Driver.FindElement(txtPickUpDate).GetAttribute("value"), "Verify Pickup Date is set back to default (next work day)"); Assert.AreEqual("Delivery Location Type", Driver.FindElement(optDeliveryLocationTypeDefault).Text, "Verify Delivery Location Type is set back to default ('Delivery Location Type')"); Assert.AreEqual("United States of America", Driver.FindElement(optDeliveryCountryDefault).Text.ToString(), "Verify Delivery Country is set back to default ('United States of America')"); Assert.IsEmpty(Driver.FindElement(txtCityDestination).Text.ToString(), "Verify Delivery City, State, Zip code is Blank/Empty"); Assert.AreEqual("1", Driver.FindElement(txtInputQuantity).GetAttribute("value"), "Verify item quantity is set back to default ('1')"); Assert.IsEmpty(Driver.FindElement(optPackageTypeDefault).Text.ToString(), "Verify package type is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtInputLength).Text.ToString(), "Verify that length is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtInputWidth).Text.ToString(), "Verify that width is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtInputHeight).Text.ToString(), "Verify that height is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtInputWeight).Text.ToString(), "Verify that weight is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtItemValue).Text.ToString(), "Verify that item value is Blank/Empty"); if (stackable == true) { Assert.IsTrue(Driver.FindElement(chkStackable).GetAttribute("class").Contains("ng-empty"), "Verify that 'Stackable' checkbox is unchecked"); } else { if (Driver.FindElement(chkHazardous).GetAttribute("class").Contains("ng-empty")) { Driver.Click(chkHazardous, "Click 'Hazardous' option"); } Assert.IsEmpty(Driver.FindElement(txtHazmatUN).Text.ToString(), "Verify that Hazmat UN No is Blank/Empty"); Assert.AreEqual("?", Driver.FindElement(txtHazmatPckGrp).GetAttribute("value").ToString(), "Verify that Hazmat Pak. Group is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(optHazmatClassDefault).Text.ToString(), "Verify that Hazmat Class is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtHazmatEmergencyRes).Text.ToString(), "Verify that Hazmat Company is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtHazmatContractId).Text.ToString(), "Verify that Hazmat contract id is Blank/Empty"); Assert.IsEmpty(Driver.FindElement(txtHazmatPhoneNo).Text.ToString(), "Verify that Hazmat Phone no is Blank/Empty"); Assert.IsTrue(Driver.FindElement(txtHazmatInstructions).GetAttribute("class").Contains("ng-empty"), "Verify that Hazmat instructions is Blank/Empty"); } }
public void GetConfirmationLTL(bool checkAllCanadaDocuments = false, bool verifyLoadinShipmentHistory = false, bool isCanada = false, bool hasIns = false, bool isHazMat = false) { WaitForLoadIndicator(); Driver.WaitForCondition(d => Driver.IsDisplayed(lblThankYou, "Validate Thank you text"), "Wait for Thank you text to load"); Driver.WaitForCondition(d => Driver.IsDisplayed(lblConfirmationId, "Check if confirmation number is displayed"), "Wait for confirmation number to load"); //BOL info long ConfirmationId = Convert.ToInt64(Driver.FindElement(lblConfirmationId).Text); var bolId = (from ld in DataContext.loadPLS20 where ld.load_id == ConfirmationId select ld).SingleOrDefault(); Assert.AreEqual(ConfirmationId.ToString(), bolId.bol, "Validate BOL in database"); int pckDays; int delDays; DateTime pickupDate; DateTime deliveryDate; if (isCanada == false) { pckDays = WC.GetWorkingDay(DateTime.Today, InputData.Data.numPickupDays); pickupDate = DateTime.Today.AddDays(pckDays); delDays = WC.GetWorkingDeliveryDay(pickupDate, InputData.Data.numDeliveryDays); deliveryDate = pickupDate.AddDays(delDays); Assert.AreEqual(InputData.Data.CarrierName, Driver.FindElement(lblCarrierId).Text, "Validate Carrier Information"); } else { pckDays = WC.GetWorkingDay(DateTime.Today, InputData.Data.numPickupDaysCAN, isCanada); pickupDate = DateTime.Today.AddDays(pckDays); delDays = WC.GetWorkingDeliveryDay(pickupDate, InputData.Data.numDeliveryDaysCAN, isCanada); deliveryDate = pickupDate.AddDays(delDays); Assert.AreEqual(InputData.Data.CarrierNameCAN, Driver.FindElement(lblCarrierId).Text, "Validate Carrier Information"); } VerifyLoadDetails(pickupDate, deliveryDate, isCanada); VerifyLoadCostLTL(isCanada, hasIns); // Item condition / Package Type Assert.AreEqual(InputData.Data.selCondition, Driver.FindElement(lblItemCondition).Text, "Validate item condition"); Assert.AreEqual(InputData.Data.selPackageType, Driver.FindElement(lblPackageType).Text, "Validate item package type"); VerifyEmailContent(ConfirmationId, pickupDate, isCanada, hasIns); string downloadPath; if (RunLocal == false) { downloadPath = downloadPath_Remote; } else { downloadPath = downloadPath_LocalUser; } CheckBOLDocumentLTL(ConfirmationId, downloadPath, isCanada, isHazMat); // Currently only handles new user entered vendor and purchaser addresses with a user entered Customs Broker if (checkAllCanadaDocuments == true) { CheckNAFTADocument(ConfirmationId, downloadPath); CheckSLIDocument(ConfirmationId, downloadPath); CheckPLDocument(ConfirmationId, downloadPath); CheckCCIDocument(ConfirmationId, downloadPath); CheckCIDocument(ConfirmationId, downloadPath); } if (verifyLoadinShipmentHistory) { Driver.Click(lblProfile, "Click profile dropdown"); Driver.Click(lnkProfilePage, "Click 'Profile' to navigate to user profile"); UserProfilePage profile = new UserProfilePage(Driver, Assert); profile.LookupLoadLTL(ConfirmationId, pickupDate, deliveryDate, isCanada); } }