public InputPage AddPage(string a_pageName)
    {
        var page = new InputPage(a_pageName);

        m_inputPageList.Add(page);
        return(page);
    }
Esempio n. 2
0
        public void Fixture_Initialize_ToInputForm(InputPage inputPage)
        {
            inputPage.AutoFill();

            inputPage.Get.Value.From("#FirstName").All(char.IsLetter).Should().BeTrue();

            inputPage.Get.Value.From("#LastName").All(char.IsLetter).Should().BeTrue();
        }
Esempio n. 3
0
        public void SetupTest()
        {
            baseURL = Configuration.Get("BaseURL");
            ChromeOptions options = new ChromeOptions();

            // DesiredCapabilities capabilities = new DesiredCapabilities();
            //    Driver.Add(Configuration.Get("Browser"), Path.GetFullPath("/home/wers4/Projects/Qaautomation_softek/Qaautomation_softek"), capabilities);
            driver    = new ChromeDriver(Path.GetFullPath("/home/wers4/Projects/Qaautomation_softek/Qaautomation_softek"), options);
            inputPage = new InputPage(driver);
            inputPage.Navigate();
        }
Esempio n. 4
0
        public void Fixture_InlineData_CorrectDataPopulated(InputPage inputPage, string helloString, int intValue)
        {
            helloString.Should().Be("Hello");

            intValue.Should().Be(5);

            inputPage.AutoFill();

            inputPage.Get.Value.From("#FirstName").All(char.IsLetter).Should().BeTrue();

            inputPage.Get.Value.From("#LastName").All(char.IsLetter).Should().BeTrue();
        }
        public ActionResult Index(InputPage model)
        {
            try
            {
                // Verification
                if (ModelState.IsValid)
                {
                    // Initialization.
                    List <Country> countryList = this.LoadData();

                    // Selected countries list.
                    model.Countries.SelectedCountryLst = countryList.Where(p => model.Countries.SelectedMultiCountryId.Contains(p.Country_Id)).Select(q => q).ToList();
                }

                // Loading drop down lists.
                this.ViewBag.CountryList = this.GetCountryList();

                List <Result> results = new List <Result>();
                for (int i = 0; i < model.Countries.SelectedMultiCountryId.Count(); i++)
                {
                    Result result = new Result();
                    result.SelectedCountry = getCountryById(model.Countries.SelectedMultiCountryId[i]);


                    result.BusinessDays = calculateBusinessDays(model, result.SelectedCountry);
                    float fine = 0f;
                    if (model.CheckOut.AddDays(10) > model.Return)
                    {
                        //calculating fine
                        for (int j = 0; j < result.BusinessDays; j++)
                        {
                            fine += result.SelectedCountry.perDayFine;
                        }
                    }
                    result.Fine = fine;
                    results.Add(result);
                }

                model.Results = results;
                return(View(model));
            }
            catch (Exception ex)
            {
                // Info
                Console.Write(ex);
            }

            // Info
            return(this.View(model));
        }
        public ActionResult InputPage()
        {
            InputPage inputPage = new InputPage();

            //inputPage.Countries = new List<Country>();

            //Country country = new Country();
            //country.Id = 1;
            //country.Name = "Pakistan";
            //inputPage.Countries.Add(country);

            //country.Id = 2;
            //country.Name = "Turkey";
            //inputPage.Countries.Add(country);

            return(View(inputPage));
        }
        private int calculateBusinessDays(InputPage inputPage, Country SelectedCountry)
        {
            DateTime date         = inputPage.CheckOut;
            int      businessDays = 0;

            while (date != inputPage.Return)
            {
                for (int i = 0; i < SelectedCountry.Holidays.Count(); i++)
                {
                    Holiday holiday = SelectedCountry.Holidays[i];
                    if (date != holiday.Date)
                    {
                        businessDays++;
                    }
                }
                date.AddDays(1);
            }
            return(businessDays);
        }
        /// <summary>
        /// Get: /MultiSelectDropDown/Index method.
        /// </summary>
        /// <returns>Return index view</returns>
        public ActionResult Index()
        {
            // Initialization.
            InputPage inputPage = new InputPage();

            inputPage.Countries = new MultiSelectDropDownViewModel {
                SelectedMultiCountryId = new List <int>(), SelectedCountryLst = new List <Country>()
            };

            try
            {
                // Loading drop down lists.
                this.ViewBag.CountryList = this.GetCountryList();
            }
            catch (Exception ex)
            {
                // Info
                Console.Write(ex);
            }

            // Info.
            return(this.View(inputPage));
        }
Esempio n. 9
0
 protected override void OnSetUp()
 {
     page = Go.To<InputPage>();
 }
    private void OnPageChanged()
    {
        var pageName = m_inputPageStack.Peek();

        m_curPage = GetPage(pageName);
    }