Пример #1
0
        public void Common_methods()
        {
            Global.Driver.wait(5);
            //Click on the Owners tab
            Tenanttab.Click();

            //Click MyRequest tab
            MyRequesttab.Click();
            //click add request tab
            Addrequesttab.Click();
            //click Select property
            SelectProperty.Click();
            //select dropdown
            SelectPropertydropdown.Click();
            //Type dropdown
            TypeDropDown.Click();
            TypeOption.Click();
            Message.SendKeys(ExcelLib.ReadData(3, "TestData"));
            SaveButton.Click();
            Tenanttab2.Click();
            MyRequesttab2.Click();
            //Enter the value in the search bar
            SearchBar.SendKeys("automate test for verification");
            Global.Driver.wait(5);

            //Click on the search button
            SearchButton.Click();
        }
Пример #2
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();
        }
Пример #3
0
        private static string GetSelectPropertyType(SelectProperty prop)
        {
            string typeName = GetEnumTypeName(prop);

            if (renameMap.ContainsKey(typeName))
            {
                typeName = renameMap[typeName];
            }

            return(typeName + "Enum");
        }
Пример #4
0
        private static string GetEnumTypeName(SelectProperty prop)
        {
            string typeName = Helpers.NormalizeString(prop.Name);

            // find the enums that start with the same name
            var listOfEnum = mapTypeToMembers.Keys
                             .Where(k => k.StartsWith(typeName, StringComparison.OrdinalIgnoreCase))
                             .ToList();

            if (listOfEnum.Count() == 1)
            {
                return(listOfEnum.First());
            }

            // Creating the current props so that we don't re-run the normalize multiple times.
            Dictionary <string, string> props = prop.Options.ToDictionary
                                                (
                key => Helpers.NormalizeString(key),
                value => value
                                                );

            //find the enum that contains all the required values
            foreach (var item in listOfEnum)
            {
                // get the list of enum values to look for
                Dictionary <string, string> toSearchFor = new Dictionary <string, string>(props);
                foreach (var looking in mapTypeToMembers[item])
                {
                    //todo  == can we just use looking.value?
                    toSearchFor.Remove(Helpers.NormalizeString(looking.Key));
                }
                if (toSearchFor.Count == 0)
                {
                    return(item);
                }
            }

            // We should not get here
            throw new InvalidOperationException(string.Format("Could not find the enum {0}", typeName));
        }
        internal void ListPropMethod()
        {
            try
            {
                SelectProperty.Click();
                Driver.wait(2);

                ExcelLib.PopulateInCollection(Base.ExcelPath, "PropertyDetails");
                PropTitle.SendKeys(ExcelLib.ReadData(2, "Title"));
                int actualLimit = ExcelLib.ReadData(2, "Title").Length;
                if (actualLimit >= 10)
                {
                    PropDescription.SendKeys(ExcelLib.ReadData(2, "Description"));
                    int DescLimit = ExcelLib.ReadData(2, "Description").Length;
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Limit of characters for Title is verified");
                    if (DescLimit >= 10)
                    {
                        PropMovingCost.SendKeys(ExcelLib.ReadData(2, "Moving Cost"));
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Limit of characters in Description is verified");
                        decimal d;
                        if (decimal.TryParse(ExcelLib.ReadData(2, "Moving Cost"), out d))
                        {
                            PropTargetRent.SendKeys(ExcelLib.ReadData(2, "TargetRent"));
                            Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Limit of Decimal in Moving Cost is verified");
                            if (decimal.TryParse(ExcelLib.ReadData(2, "TargetRent"), out d))
                            {
                                PropAvailabledate.Click();
                                PropOccupantCount.SendKeys(ExcelLib.ReadData(2, "Occupants Count"));
                                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Limit of Decimal in Target Rent is verified");
                                if (decimal.TryParse(ExcelLib.ReadData(2, "Occupants Count"), out d))
                                {
                                    PropSave.Click();
                                    Driver.wait(5);
                                    Driver.driver.SwitchTo().Alert().Accept();
                                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Numeric Value for Occupants count has been verified");
                                }
                                else
                                {
                                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Occupant Count doesn't have numeric value");
                                }
                                //}
                                //else
                                //{
                                //  Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Available date format is not accepted");
                                //}
                            }
                            else
                            {
                                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Target Rent doesn't have decimal value");
                            }
                        }
                        else
                        {
                            Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Moving Cost doesn't have decimal value");
                        }
                    }
                    else
                    {
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Description does not contain minimun of 10 Characters");
                    }
                }
                else
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Limit of characters in Title is less than 10");
                }
            }
            catch (Exception Ex)
            {
                string excepMessage = Ex.Message;
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, excepMessage + "Error while adding a Property to List as Rental");
            }
        }
Пример #6
0
        /// <summary>
        /// Called after the view is loaded.
        /// </summary>
        protected override void AfterLoad()
        {
            base.AfterLoad();
            if (IgnoreObject)
            {
                return;
            }

            // add unity event system triggers
            if (!BeginDragProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, BeginDrag, EventTriggerType.BeginDrag);
            }
            if (!CancelProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Cancel, EventTriggerType.Cancel);
            }
            if (!DeselectProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Deselect, EventTriggerType.Deselect);
            }
            if (!DragProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Drag, EventTriggerType.Drag);
            }
            if (!DropProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Drop, EventTriggerType.Drop);
            }
            if (!EndDragProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, EndDrag, EventTriggerType.EndDrag);
            }
            if (!InitializePotentialDragProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, InitializePotentialDrag, EventTriggerType.InitializePotentialDrag);
            }
            if (!MoveProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Move, EventTriggerType.Move);
            }
            if (!ClickProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Click, EventTriggerType.PointerClick);
            }
            if (!MouseDownProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, MouseDown, EventTriggerType.PointerDown);
            }
            if (!MouseEnterProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, MouseEnter, EventTriggerType.PointerEnter);
            }
            if (!MouseExitProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, MouseExit, EventTriggerType.PointerExit);
            }
            if (!MouseUpProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, MouseUp, EventTriggerType.PointerUp);
            }
            if (!ScrollProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Scroll, EventTriggerType.Scroll);
            }
            if (!SelectProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Select, EventTriggerType.Select);
            }
            if (!SubmitProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, Submit, EventTriggerType.Submit);
            }
            if (!UpdateSelectedProperty.IsUndefined(this))
            {
                GameObject.AddEventTrigger(this, UpdateSelected, EventTriggerType.UpdateSelected);
            }

            IsActiveChanged(false);
        }