Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        public void LoadCogsCalculation()
        {
            string       customerId = load.OptiCustomerId;
            string       carrierId  = load.OptiCarrierId;
            string       uniqueName = "qa" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
            AccountsPage optimizerAccountsPageElements = new AccountsPage()
                                                         .SyncCustomerWithTlrg(customerId);
            SettingsPage settingsPage = new SettingsPage()
                                        .ClickCustomerSettingsGeneralLink()
                                        //.SearchAndSelectCustomer(customerId)
                                        //.SetCustomerGeneralFields("2", "125", "1", uniqueName + "@echo.com", "(GMT -6:00) Central Time (US & Canada), Mexico City")
                                        //.ClickSaveButton()
                                        //.WaitForSaveConfirmation()
                                        .SyncNewCarrier(carrierId);
            PricingUploadPage pricingUploadPage = new PricingUploadPage()
                                                  .UploadLineHaulMultiRates(customerId, carrierId, uniqueName)
                                                  .UploadFuelSchedule(customerId, carrierId)
                                                  .UploadSpecialServices(customerId, carrierId);

            CreateMultiStopLoadShipmentBuilder();
            string expectedLoadId = loadDetailsPage.GetLoadIdDisplayed();

            loadDetailsPage.ClickElement(loadDetailsPage.StartTlrgButton);
            string actualWarning   = driver.FindElementBy(loadDetailsPage.LoadWarning).Text;
            string expectedWarning = "You are currently viewing a READ ONLY version of this page. No changes are allowed.";
            string expectedStatus  = "In Progress";

            Assert.AreEqual(expectedWarning, actualWarning);
            HomePage homePage     = new HomePage();
            string   expectedCogs = homePage.GetLoadCogs(expectedLoadId, 0.01, 100.00, 215.00, 0.3, 1000.00);

            homePage.ClickAllTab()
            .WaitForStartTlrgLoad(expectedLoadId, customerId, expectedStatus)
            .SearchAndSelectCustomer(customerId)
            .FilterLoads(homePage.LoadIdField, expectedLoadId);
            IList <string> actualLoad   = homePage.GetLoadAtIndex(0);
            string         actualLoadId = actualLoad[0];
            string         actualCogs   = actualLoad[3];
            string         actualStatus = actualLoad[4];

            Assert.AreEqual(expectedLoadId, actualLoadId);
            Assert.AreEqual(expectedCogs, actualCogs);
            Assert.AreEqual(expectedStatus, actualStatus);
        }