示例#1
0
        public void Enter_Value_ListARentalPage()
        {
            // var SelectElement = new SelectElement(SelectProp);
            // SelectElement.SelectByIndex(1);

            Actions actions = new Actions(_driver);

            actions.MoveToElement(SelectProp);
            actions.Click();
            actions.SendKeys("1222 High Street, Taita, Lower Hutt, 5011");
            actions.Build().Perform();
            System.Threading.Thread.Sleep(50);


            Title.SendKeys("TestTitleNewToRent");
            Description.SendKeys("Description To Test");
            MovingCost.SendKeys("2000");
            TargetRent.SendKeys("200");
            AvailableDate.SendKeys("10/05/2019");
            System.Threading.Thread.Sleep(50);

            OccupantsCount.SendKeys("2");
            UploadPhoto.SendKeys(@"C:\Users\Mallik\Desktop\Test.jpg");
            System.Threading.Thread.Sleep(50);


            Save.Click();

            // IAlert alert = _driver.SwitchTo().Alert();
            //  alert.Accept();

            // System.Threading.Thread.Sleep(50);
        }
示例#2
0
        public void Enter_Value_ListARentalPage()
        {
            // var SelectElement = new SelectElement(SelectProp);
            // SelectElement.SelectByIndex(1);

            Actions actions = new Actions(_driver);

            actions.MoveToElement(SelectProp);
            actions.Click();
            actions.SendKeys("1222 High Street, Taita, Lower Hutt, 5011");
            actions.Build().Perform();
            System.Threading.Thread.Sleep(200);


            Title.SendKeys("TestTitleNewToRent");
            Description.SendKeys("Description To Test");
            MovingCost.SendKeys("2000");
            TargetRent.SendKeys("200");
            AvailableDate.Click();
            AvailableDate.Clear();
            AvailableDate.SendKeys("16/07/2019");
            System.Threading.Thread.Sleep(250);

            OccupantsCount.SendKeys("2");
            UploadPhoto.SendKeys(@"C:\Users\Mallik\Documents\Key-Project\property-connect-home.jpg");
            System.Threading.Thread.Sleep(150);

            Save.Click();
            _Wait.Until(condition: ExpectedConditions.ElementExists(By.Id("SearchBox")));

            // IAlert alert = _driver.SwitchTo().Alert();
            // alert.Accept();

            // System.Threading.Thread.Sleep(50);
        }
示例#3
0
        //Add a renatal property
        internal void ListARental()
        {
            //To skip the highlighted option
            SkipButton?.Click();
            System.Threading.Thread.Sleep(5000);
            // Populating the data from Excel
            ExcelLib.PopulateInCollection(Base.ExcelPath, "AddNewProperty");
            OwnersSelect.Click();
            System.Threading.Thread.Sleep(5000);
            PropertiesSelect.Click();
            ListRental.Click();
            //Value set for adding rental property
            SelectProperty.SendKeys(ExcelLib.ReadData(10, "RentalPropertyValue"));
            Title.SendKeys(ExcelLib.ReadData(2, "RentalPropertyValue"));
            MovingCost.SendKeys(ExcelLib.ReadData(3, "RentalPropertyValue"));
            RentalDescription.SendKeys(ExcelLib.ReadData(7, "RentalPropertyValue"));
            RentalTargetRent.SendKeys(ExcelLib.ReadData(4, "RentalPropertyValue"));
            Furnishing.SendKeys(ExcelLib.ReadData(8, "RentalPropertyValue"));
            AvailableDate.SendKeys(ExcelLib.ReadData(5, "RentalPropertyValue"));
            IdealTenant.SendKeys(ExcelLib.ReadData(9, "RentalPropertyValue"));
            Occupants.SendKeys(ExcelLib.ReadData(6, "RentalPropertyValue"));
            SaveRental.Click();

            IAlert alert = Global.Driver.driver.SwitchTo().Alert();

            alert.Accept();
        }
        public JsonResult GetSlotsLists(string AvailableDate)
        {
            //Session["CandidateId"]
            DateTime      dtAvailabledate  = Convert.ToDateTime(Convert.ToDateTime(AvailableDate).ToShortDateString());
            int           AvailableDatesId = 0;
            AvailableDate chkAvailabledate = candDal.AvailableDateByDate(dtAvailabledate);

            if (chkAvailabledate != null)
            {
                AvailableDatesId = chkAvailabledate.AvailableDatesId;
            }
            List <AvailableSeatsForDate> chkavailableSeatsForDate = candDal.AvailableSeatsForDate(AvailableDatesId);

            return(Json(chkavailableSeatsForDate));
        }
        private void UpdateRoomAvailability(DateTime startDate, DateTime endDate, Room room, AvailableDate availablePeriod)
        {
            room.AvailableDates.Remove(availablePeriod);
            var periodBeforeBooking = startDate - availablePeriod.StartDate;
            if (periodBeforeBooking > TimeSpan.Zero)
            {
                room.AvailableDates.Add(new AvailableDate(availablePeriod.StartDate, availablePeriod.StartDate.Add(periodBeforeBooking)));
            }

            var periodAfterBooking = availablePeriod.EndDate - endDate;
            if (periodAfterBooking > TimeSpan.Zero)
            {
                room.AvailableDates.Add(new AvailableDate(availablePeriod.EndDate.Subtract(periodAfterBooking), availablePeriod.EndDate));
            }
        }
示例#6
0
        // This works, don't touch!
        private void UpdateRoomAvailability(DateTime startDate, DateTime endDate, Room room, AvailableDate availablePeriod)
        {
            room.AvailableDates.Remove(availablePeriod);
            var periodBeforeBooking = startDate - availablePeriod.StartDate;

            if (periodBeforeBooking > TimeSpan.Zero)
            {
                room.AvailableDates.Add(new AvailableDate(availablePeriod.StartDate, availablePeriod.StartDate.Add(periodBeforeBooking)));
            }

            var periodAfterBooking = availablePeriod.EndDate - endDate;

            if (periodAfterBooking > TimeSpan.Zero)
            {
                room.AvailableDates.Add(new AvailableDate(availablePeriod.EndDate.Subtract(periodAfterBooking), availablePeriod.EndDate));
            }
        }
示例#7
0
        public AvailableDate AvailableDateByDate(DateTime dtAvailabledate)
        {
            AvailableDate chkAvailabledate = db.AvailableDates.Where(ad => ad.AvailableDate1 == dtAvailabledate).ToList().FirstOrDefault();

            return(chkAvailabledate);
        }
示例#8
0
        internal void ListAsRental()
        {
            //Populate excel file
            ExcelLib.PopulateInCollection(Config.Keys_Resource.ExcelPath, "ListRental");
            Thread.Sleep(1000);

            //calling the common methods
            Common_methods();
            Thread.Sleep(500);

            //Select properties page
            PropertiesPage.Click();

            //Clicking on save button
            ListaRental.Click();
            Driver.wait(2000);

            //Enter Title
            Title.SendKeys(ExcelLib.ReadData(2, "Title"));
            Driver.wait(2000);

            //Enter moving cost
            MovingCost.SendKeys(ExcelLib.ReadData(2, "MovingCost"));
            Driver.wait(2000);

            //Enter List Description
            ListDescription.SendKeys(ExcelLib.ReadData(2, "Description"));
            Driver.wait(2000);

            //Enter List target rent
            ListTargetRent.SendKeys(ExcelLib.ReadData(2, "TargetRent"));
            Driver.wait(2000);

            //Enter Available date
            AvailableDate.Clear();
            Driver.wait(500);
            AvailableDate.SendKeys("31/08/2018");
            Driver.wait(2000);

            //Enter Occupant Count
            OccupantCount.SendKeys(ExcelLib.ReadData(2, "Occupants"));
            Driver.wait(2000);

            //Upload a file thru AutoIT
            Driver.wait(1000);
            AutoItX3 autoIT = new AutoItX3();

            Uploadingfile.Click();
            autoIT.WinActivate("Open");
            Thread.Sleep(1000);
            autoIT.Send(@"C:\Users\VictorFelix\source\repos\automationOnboardingSample-master\Keys_Onboarding\TestReports\Screenshots\home.jpg");
            Thread.Sleep(1000);
            autoIT.Send("{Enter}");
            Thread.Sleep(1000);

            //Clicking on Save
            ListSave.Click();
            Driver.wait(2000);

            //Clicking on OK on Alert
            //Driver.driver.SwitchTo().Alert().Accept();
            //Driver.wait(2000);

            //Click on the Owners tab
            Ownertab.Click();
            Thread.Sleep(1000);

            //Click on the Rental Listings button
            RentalListings.Click();
            Thread.Sleep(1000);

            //Search for added list property
            SearchBox.SendKeys(ExcelLib.ReadData(2, "Title"));
            Driver.wait(2000);

            //Clicking on Search icon
            SearchBtn.Click();
            Driver.wait(2000);
        }