Пример #1
0
        private bool Fill_AddCarrier()
        {
            UIItem CarrierCode    = new UIItem("Routing Guide>> Carrier Code", byCarrierCode, _driver);
            UIItem LineItems      = new UIItem("Routing Guide>> LineItems", byLineItems, _driver);
            UIItem LineItemsUnit  = new UIItem("Routing Guide>> LineItemsUnit", byLineItemsUnit, _driver);
            UIItem TimeAllowed    = new UIItem("Routing Guide>> TimeAllowed", byTimeAllowed, _driver);
            UIItem CarrierEffDate = new UIItem("Routing Guide>> CarrierEffDate", byCarrierEffDate, _driver);
            UIItem CarrierExpDate = new UIItem("Routing Guide>> CarrierExpDate", byCarrierExpDate, _driver);

            try
            {
                int indexLineItem = LineItems.GetCountOfElements();
                int indexCarrier  = CarrierEffDate.GetCountOfElements();
                Assert.IsTrue(CarrierCode.WaitUntilDisplayed());
                if (carrierCode != "!IGNORE!")
                {
                    Assert.IsTrue(CarrierCode.TypeAndSelect(carrierCode));
                    Assert.IsTrue(CarrierCode.WaitUntilDisabled());
                }
                Assert.IsTrue(LineItems.ClearAndEditByIndex(lineItems, indexLineItem));
                Assert.IsTrue(LineItemsUnit.ClearAndEditByIndex(lineItemsUnit, indexLineItem));
                Assert.IsTrue(TimeAllowed.ClearAndEditByIndex(timeAllowed, indexCarrier));
                CarrierExpDate.ScrollToElement(CarrierExpDate.ElementByIndex(indexCarrier));
                Assert.IsTrue(CarrierExpDate.WaitUntilDisplayed());
                Assert.IsTrue(CarrierExpDate.ClearAndEditByIndex(carrierExpDate, indexCarrier));
                Assert.IsTrue(CarrierEffDate.ClearAndEditByIndex(carrierEffDate, indexCarrier));

                return(true);
            }
            catch
            {
                return(false);
            }
        }