Exemplo n.º 1
0
 public void ThenRefreshThePageAndMakeSureThatAllTheDataIsStillPresentAndValid_()
 {
     Driver.Navigate().Refresh();
     Hooks.WaitIsDisplayed(PageObject.FirstNameField);
     Assert.AreEqual(NeededDate(1, true), PageObject.OrderReviewFromDate.Text);
     Assert.AreEqual(NeededDate(2, true), PageObject.OrderReviewToDate.Text);
     Assert.AreEqual(PageObject.FirstNameField.GetAttribute("value"), Constants.FirstName);
     Assert.AreEqual(PageObject.LastNameField.GetAttribute("value"), Constants.LastName);
     Assert.AreEqual(PageObject.PhoneNoField.GetAttribute("value"), Constants.PhoneNo);
     Assert.AreEqual(PageObject.EmailField.GetAttribute("value"), Constants.Email);
     Assert.AreEqual(PageObject.CompanyTitleField.GetAttribute("value"), Constants.CompanyTitle);
     Assert.AreEqual(PageObject.CompanyCodeField.GetAttribute("value"), Constants.CompanyCode);
     Assert.AreEqual(PageObject.CompanyAddressField.GetAttribute("value"), Constants.CompanyAddress);
     Assert.AreEqual(PageObject.CompanyVatCodeField.GetAttribute("value"), Constants.VatCode);
 }
Exemplo n.º 2
0
        public void GivenAddLastExtraServiceForTwoAdults()
        {
            Hooks.WaitIsDisplayed(PageObject.ExtraBookingOptions[0]);
            var extraOptions = PageObject.ExtraBookingOptions;
            var neededOption = "0";

            foreach (var option in extraOptions)
            {
                if (option.Displayed)
                {
                    neededOption = option.GetAttribute("data-id");
                }
            }
            Driver.FindElement(By.XPath("//table[@data-id='" + neededOption + "']//a[@class='up']")).Click();
            Driver.FindElement(By.XPath("//table[@data-id='" + neededOption + "']//a[@class='up']")).Click();
        }
Exemplo n.º 3
0
 public void ThenFillAllThePersonalDataIncludingAllTheAgreementsAndOptionsAvailable()
 {
     Hooks.WaitIsDisplayed(PageObject.FirstNameField);
     PageObject.FirstNameField.SendKeys(Constants.FirstName);
     PageObject.LastNameField.SendKeys(Constants.LastName);
     PageObject.PhoneNoField.SendKeys(Constants.PhoneNo);
     PageObject.EmailField.SendKeys(Constants.Email);
     PageObject.NewsletterCheckbox.Click();
     PageObject.ReceiptCheckbox.Click();
     PageObject.CompanyTitleField.SendKeys(Constants.CompanyTitle);
     PageObject.CompanyCodeField.SendKeys(Constants.CompanyCode);
     PageObject.CompanyAddressField.SendKeys(Constants.CompanyAddress);
     PageObject.CompanyVatCodeField.SendKeys(Constants.VatCode);
     PageObject.RulesCheckbox.Click();
     Hooks.WaitIsDisplayed(PageObject.AcceptTermsButton, false, true);
 }
Exemplo n.º 4
0
        public void GivenSelectVilniusCheapestZone()
        {
            Driver.FindElement(By.XPath("//div[@class='zone-select-div']//a[contains(text(),'Vilniaus')]")).Click();
            Hooks.WaitIsDisplayed(PageObject.ParkingOptionPrices[0]);
            var          parkingOptions = PageObject.ParkingOptionPrices;
            List <float> prices         = new List <float>();

            foreach (var parkingOption in parkingOptions)
            {
                string priceGet    = parkingOption.Text;
                string parsedPrice = Regex.Replace(priceGet, "[A-Za-zž,]", "");
                if (parsedPrice != String.Empty)
                {
                    prices.Add(Int32.Parse(parsedPrice));
                }
            }

            var cheapest  = prices.Min();
            var cheapest2 = cheapest.ToString();

            Driver.FindElement(By.XPath("//div[@class='choose']//td[contains(text(), '" + cheapest2.Remove(cheapest2.Length - 2) + "')]/..//a[@title='Toliau']")).Click();
        }
Exemplo n.º 5
0
 public void ThenDeleteAtLeastOneOfTheMandatoryFieldsAndCheckThatAtLeastOneErrorMessageIsDisplayed_()
 {
     PageObject.EmailField.Clear();
     Hooks.WaitIsDisplayed(PageObject.SubmitParkingOrder, click: true);
     Hooks.WaitIsDisplayed(PageObject.GeneralErrorMessage);
 }