Exemple #1
0
 public void GivenSetToDateToTwoDaysFromNowOnAndTimeThatIsTheClosestOneToTheFromDate()
 {
     Thread.Sleep(1000);
     Driver.FindElement(By.XPath("//table[@class= 'ui-datepicker-calendar']//a[contains(text(),'" + NeededDate(2) + "')]")).Click();
     Hooks.WaitIsDisplayed(PageObject.EndHourField, click: true);
     Driver.FindElement(By.XPath("//ul[@class='ui-timepicker-list']/li[contains(text(),'14:59')]")).Click();
 }
Exemple #2
0
 public void GivenChooseTheFromDateToBeTomorrowPM()
 {
     Hooks.WaitIsDisplayed(PageObject.StartDateField, click: true);
     Driver.FindElement(By.XPath("//table[@class= 'ui-datepicker-calendar']//a[contains(text(),'" + NeededDate(1) + "')]")).Click();
     Hooks.WaitIsDisplayed(PageObject.CookieConsentAcceptField, click: true);
     PageObject.StartHourField.Click();
     Driver.FindElement(By.XPath("//ul[@class='ui-timepicker-list']/li[contains(text(),'15:00')]")).Click();
 }
Exemple #3
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);
 }
Exemple #4
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);
 }
Exemple #5
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();
        }
Exemple #6
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();
        }
Exemple #7
0
 public void ThenDeleteAtLeastOneOfTheMandatoryFieldsAndCheckThatAtLeastOneErrorMessageIsDisplayed_()
 {
     PageObject.EmailField.Clear();
     Hooks.WaitIsDisplayed(PageObject.SubmitParkingOrder, click: true);
     Hooks.WaitIsDisplayed(PageObject.GeneralErrorMessage);
 }