Ejemplo n.º 1
0
            public static TabComponent Read(BinaryReader br)
            {
                TabComponent ret = new TabComponent();

                ret.Data = br.ReadStructures <UInt32>(4).ToArray();
                return(ret);
            }
    public void UpdateBodyContentSize()
    {
        tab.geometry.tabContent.rect.width  = 0;
        tab.geometry.tabContent.rect.height = 0;

        /*
         *
         * for (int i= 0;i< tab.structure.childrenTabs.Count;i++) { tab.geometry.tabContent.rect = AddToRect(tab.geometry.tabContent.rect, tab.structure.childrenTabs[i].tab.geometry.tabContainer.rect); }
         * for (int i= 0;i< tab.structure.childrenTextAreas.Count;i++) { tab.geometry.tabContent.rect = AddToRect(tab.geometry.tabContent.rect, tab.structure.childrenTextAreas[i].textarea.geometry.textareaBody.rect); }
         * for (int i= 0;i< tab.structure.childrenButtons.Count;i++) { tab.geometry.tabContent.rect = AddToRect(tab.geometry.tabContent.rect, tab.structure.childrenButtons[i].button.geometry.buttonBody.rect); }
         */
        for (int i = 0; i < tab.structure.children.Components.Count; i++)
        {
            TabComponent      childTab      = tab.structure.children.Components[i].GetComponent <TabComponent>();
            ButtonComponent   childButton   = tab.structure.children.Components[i].GetComponent <ButtonComponent>();
            TextareaComponent childTextarea = tab.structure.children.Components[i].GetComponent <TextareaComponent>();

            if (childTab != null)
            {
                tab.geometry.tabContent.rect = AddToRect(tab.geometry.tabContent.rect, childTab.tab.geometry.tabContainer.rect);
            }
            else
            if (childButton != null)
            {
                tab.geometry.tabContent.rect = AddToRect(tab.geometry.tabContent.rect, childButton.button.geometry.buttonBody.rect);
            }
            else
            if (childTextarea != null)
            {
                tab.geometry.tabContent.rect = AddToRect(tab.geometry.tabContent.rect, childTextarea.textarea.geometry.textareaBody.rect);
            }
        }
    }
Ejemplo n.º 3
0
        public void CheckSaveProcess()
        {
            bool isExists = false;

            NavigateToReturnPage();
            Wait.WaitTillAllAjaxCallsComplete();

            TabComponent objTab     = new TabComponent();
            IWebElement  saveButton = objTab.GetTabElement(SeleniumHelper.AutomationId(Constant.Save_Button));

            if (saveButton.IsElementExists())
            {
                //saveButton.Click();
                SeleniumHelper.WaitForElementClickableThenClick(saveButton);

                isExists = WaitForDetailsViewAutoRefresh(Constant.Save_Button, 180);

                if (!isExists)
                {
                    Assert.IsTrue(false);
                }
            }
            else
            {
                Assert.IsTrue(false);
            }
        }
Ejemplo n.º 4
0
        public void CheckValidateProcess()
        {
            bool isExists = false;

            NavigateToReturnPage();
            Wait.WaitTillAllAjaxCallsComplete();

            TabComponent objTab         = new TabComponent();
            IWebElement  validateButton = objTab.GetTabElement(SeleniumHelper.AutomationId(Validate_Button));

            if (validateButton.IsElementExists())
            {
                //validateButton.Click();
                SeleniumHelper.WaitForElementClickableThenClick(validateButton);
                Thread.Sleep(200);
                Wait.WaitTillAllAjaxCallsComplete();
                isExists = WaitForDetailsViewAutoRefresh(Validate_Button, 299);

                if (!isExists)
                {
                    Assert.IsTrue(false);
                }
            }
            else
            {
                Assert.IsTrue(false);
            }
        }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        a = gameObject.transform.GetComponentInChildren <TabComponent>();
        b = gameObject.transform.GetComponentInChildren <ButtonComponent>();

        if (a != null)
        {
            // print(a.tab.data.name);
            //TypeGeneric.Component ge = GetGen(a.tab);
            GenericType.Component ge = TabType.Generic(a.tab);

            print(ge.data.name + "_____");
        }
        else
        {
            print("No Tabs Found");
        }



        if (b != null)
        {
            print(b.button.data.name);
        }



        //parent
    }
Ejemplo n.º 6
0
        public void CheckSignOffProcess()
        {
            bool isExists = false;

            NavigateToReturnPage();
            Wait.WaitTillAllAjaxCallsComplete();

            TabComponent objTab = new TabComponent();

            isExists = objTab.CheckTabExists(SchoolSummaryTab);

            if (isExists)
            {
                objTab.ClickTab(SchoolSummaryTab);
                Wait.WaitTillAllAjaxCallsComplete();

                TabComponent objSection    = new TabComponent();
                IWebElement  signOffButton = objSection.GetTabElement(SeleniumHelper.AutomationId(Sign_Off_Button));

                if (signOffButton.IsElementExists())
                {
                    // signOffButton.Click();
                    SeleniumHelper.WaitForElementClickableThenClick(signOffButton);
                    Thread.Sleep(200);
                    Wait.WaitTillAllAjaxCallsComplete();

                    IWebElement signOffReturnButton = objSection.GetTabElement(SeleniumHelper.AutomationId(Sign_off_return_button));

                    if (signOffReturnButton.IsElementExists())
                    {
                        // signOffReturnButton.Click();
                        SeleniumHelper.WaitForElementClickableThenClick(signOffReturnButton);
                        Thread.Sleep(200);
                        Wait.WaitTillAllAjaxCallsComplete();

                        isExists = WaitForDetailsViewAutoRefresh(Sign_Off_Button, 299);

                        if (!isExists)
                        {
                            Assert.IsTrue(false);
                        }
                    }
                    else
                    {
                        Assert.IsTrue(false);
                    }
                }
                else
                {
                    Assert.IsTrue(false);
                }
            }
            else
            {
                Assert.IsTrue(false);
            }
        }
Ejemplo n.º 7
0
        public void CheckReportsExists()
        {
            bool tabExists;

            NavigateToReturnPage();
            Wait.WaitTillAllAjaxCallsComplete();

            TabComponent objTab = new TabComponent();

            tabExists = objTab.CheckTabExists(SchoolSummaryTab);

            if (tabExists)
            {
                objTab.ClickTab(SchoolSummaryTab);
                Wait.WaitTillAllAjaxCallsComplete();

                string[] strReports = { Absentee_Det_Rpt
                                        , Address_Det_Rpt
                                        , Adopt_From_Care_Rpt
                                        , Attendance_Det_Rpt
                                        , Class_Det_Rpt
                                        , Early_Years_Rpt
                                        , Exclusion_Det_Rpt
                                        , Free_School_Meals_Rpt
                                        , General_Det_Rpt
                                        , Leaver_Basic_Det_Rpt
                                        , Preview_Summary_Report
                                        , All
                                        , Pupils_Basic_Det_Rpt
                                        , School_Dinners_Rpt
                                        , SEN_Det_Rpt
                                        , Top_Up_Funding_Rpt
                                        , Preview_Summary_Report };


                bool reportExists = false;

                ReportComponent objReport = new ReportComponent();

                for (int i = 0; i < strReports.Length; i++)
                {
                    reportExists = objReport.CheckReportExists(SeleniumHelper.AutomationId(GetReportName(strReports[i])));

                    if (!reportExists)
                    {
                        Assert.IsTrue(false);
                    }
                }
            }
            else
            {
                Assert.IsTrue(false);
            }
        }
Ejemplo n.º 8
0
        public void CheckReportsExists()
        {
            bool tabExists;

            new Return().NavigateToReturnPage();
            Wait.WaitTillAllAjaxCallsComplete();

            TabComponent objTab = new TabComponent();

            tabExists = objTab.CheckTabExists(Constant.SchoolSummaryTab);

            if (tabExists)
            {
                objTab.ClickTab(Constant.SchoolSummaryTab);
                Wait.WaitTillAllAjaxCallsComplete();

                string[] strReports = { Constant.Absentee_Det_Rpt
                                        , Constant.Address_Det_Rpt
                                        , Constant.Adopt_From_Care_Rpt
                                        , Constant.Attendance_Det_Rpt
                                        , Constant.Exclusion_Det_Rpt
                                        , Constant.Free_School_Meals_Rpt
                                        , Constant.Leaver_Basic_Det_Rpt
                                        , Constant.All
                                        , Constant.Pupils_Basic_Det_Rpt
                                        , Constant.School_Dinners_Rpt
                                        , Constant.SEN_Det_Rpt
                                        , Constant.Top_Up_Funding_Rpt
                                        , Constant.Attendance_Det_Rpt_2nd_Half };


                bool reportExists = false;

                ReportComponent objReport = new ReportComponent();

                for (int i = 0; i < strReports.Length; i++)
                {
                    reportExists = objReport.CheckReportExists(SeleniumHelper.AutomationId(strReports[i] + Constant.periodAutumn));

                    if (!reportExists)
                    {
                        Assert.IsTrue(false);
                    }
                }
            }
            else
            {
                Assert.IsTrue(false);
            }
        }
        // Get parent



        public GenericValues(Component _ele)
        {
            //Get parent
            TabComponent _parent = _ele.transform.parent.GetComponent <TabComponent>();

            if (_parent != null)
            {
                parent = _parent.tab;
            }
            else
            {
                parent.geometry = new TabType.Geometry();
                parent.geometry.tabContainer.rect.width  = Screen.width;
                parent.geometry.tabContainer.rect.height = Screen.height;
                parent.geometry.tabBody.rect.width       = Screen.width;
                parent.geometry.tabBody.rect.height      = Screen.height;
                parent.data      = new TabType.Data();
                parent.data.type = SubType.TabType.Panel;
            }

            //Get values by component
            BranchValuesComponent _branchValues = _ele.GetComponentInParent <BranchValuesComponent>();

            if (_ele.GetType() == typeof(TabComponent))
            {
                ele = TabType.Generic(_ele.GetComponents <TabComponent>()[0].tab);
                componentPosition = ele.geometry.tabContainer.position;
                branchPosition    = _branchValues.tab.geometry.tabContainer.position;
                componentSize     = ele.geometry.tabContainer.size;
                branchSize        = _branchValues.tab.geometry.tabContainer.size;
            }
            else if (_ele.GetType() == typeof(ButtonComponent))
            {
                ele = ButtonType.Generic(_ele.GetComponents <ButtonComponent>()[0].button);
                componentPosition = ele.geometry.buttonBody.position;
                branchPosition    = _branchValues.button.geometry.buttonBody.position;
                componentSize     = ele.geometry.buttonBody.size;
                branchSize        = _branchValues.button.geometry.buttonBody.size;
            }
            else if (_ele.GetType() == typeof(TextareaComponent))
            {
                ele = TextareaType.Generic(_ele.GetComponents <TextareaComponent>()[0].textarea);
                componentPosition = ele.geometry.textareaBody.position;
                branchPosition    = _branchValues.textarea.geometry.textareaBody.position;
                componentSize     = ele.geometry.textareaBody.size;
                branchSize        = _branchValues.textarea.geometry.textareaBody.size;
            }
        }
        public static void Init(List <Component> children, bool isRoot)
        {
            for (int i = 0; i < children.Count; i++)
            {
                TabComponent      tab      = children[i].GetComponent <TabComponent>();
                TextareaComponent textarea = children[i].GetComponent <TextareaComponent>();
                ButtonComponent   button   = children[i].GetComponent <ButtonComponent>();

                if (tab != null)
                {
                    tab.tab.data.isRoot = isRoot; tab.Init();
                }
                if (textarea != null)
                {
                    textarea.Init();
                }
                if (button != null)
                {
                    button.Init();
                }
            }
        }
        public static void Draw(List <Component> children)
        {
            for (int i = 0; i < children.Count; i++)
            {
                TabComponent      tab      = children[i].GetComponent <TabComponent>();
                TextareaComponent textarea = children[i].GetComponent <TextareaComponent>();
                ButtonComponent   button   = children[i].GetComponent <ButtonComponent>();

                if (tab != null)
                {
                    tab.Draw();
                }
                if (textarea != null)
                {
                    textarea.Draw();
                }
                if (button != null)
                {
                    button.Draw();
                }
            }
        }
Ejemplo n.º 12
0
        public void CheckSchoolCensusSectionExists()
        {
            bool isExists = false;

            NavigateToReturnPage();
            Wait.WaitTillAllAjaxCallsComplete();

            TabComponent objTab = new TabComponent();

            isExists = objTab.CheckTabExists(SchoolSummaryTab);

            if (isExists)
            {
                objTab.ClickTab(SchoolSummaryTab);
                Wait.WaitTillAllAjaxCallsComplete();

                TabComponent objSection = new TabComponent();
                isExists = objSection.CheckTabElementExists(SeleniumHelper.AutomationId(SchoolCensusSection));

                if (isExists)
                {
                    IWebElement dateElement = objSection.GetTabElement(SeleniumHelper.NameAttribute(CensusDate));

                    if (string.IsNullOrEmpty(dateElement.GetValue()))
                    {
                        Assert.IsTrue(false);
                    }
                }
                else
                {
                    Assert.IsTrue(false);
                }
            }
            else
            {
                Assert.IsTrue(false);
            }
        }
Ejemplo n.º 13
0
        public void CheckTabExists()
        {
            bool tabExists = false;

            NavigateToReturnPage();
            Wait.WaitTillAllAjaxCallsComplete();

            TabComponent objTab = new TabComponent();

            string[] strTabs = { SchoolSummaryTab
                                 , CensusDataCheckTab
                                 , PupilInformationTab
                                 , CensusDaySnapshotTab };

            for (int i = 0; i < strTabs.Length; i++)
            {
                tabExists = objTab.CheckTabExists(strTabs[i]);

                if (!tabExists)
                {
                    Assert.IsTrue(false);
                }
            }
        }
        private void SetY(Size eSize)

        {  //Y
            SubType.PositionGeneric values = componentValues;
            //SubType.PositionGeneric values;

            //branch
            if (componentValues.yFollowBranch || branchValues.yFollowBranch)
            {
                componentValues = branchValues;
            }

            if (values.XFill)
            {
                return;
            }                              //  Y is set by setX


            //YStick
            if (values.yStick != SubType.PositionGeneric.ystick.None)
            {
                setYStick(eSize);
                if (values.yMirror)
                {
                    position.y = eSize.h - position.y;
                }
                return;
            }

            //YFill
            if (values.YFill)
            { // all children must have same size
                int pH = (int)parent.geometry.tabBody.rect.height;
                int eH = (int)eSize.h;
                int elementCountByCol = pH / eH;
                position.y = eSize.h * ((index) % elementCountByCol);
                position.x = eSize.w * ((index) / elementCountByCol);
                if (values.yMirror)
                {
                    position.y = parent.geometry.tabBody.rect.height - eSize.h - position.y;
                }
                if (values.xMirror)
                {
                    position.x = parent.geometry.tabBody.rect.width - eSize.w - position.x;
                }
                return;
            }



            //Ystack
            if (values.YStack)
            {
                int index        = _ele.transform.GetSiblingIndex();
                int brotherCount = _ele.transform.parent.childCount;
                int i            = 0;
                if (index > 0)
                {
                    i = index - 1;
                }

                TabComponent      brotherTab      = _ele.transform.parent.GetChild(i).GetComponent <TabComponent>();
                ButtonComponent   brotherButton   = _ele.transform.parent.GetChild(i).GetComponent <ButtonComponent>();
                TextareaComponent brotherTextarea = _ele.transform.parent.GetChild(i).GetComponent <TextareaComponent>();

                Rect container = new Rect(0, 0, 0, 0);

                if (brotherTab != null)
                {
                    container = brotherTab.tab.geometry.tabContainer.rect;
                }
                if (brotherButton != null)
                {
                    container = brotherButton.button.geometry.buttonBody.rect;
                }
                if (brotherTextarea != null)
                {
                    container = brotherTextarea.textarea.geometry.textareaBody.rect;
                }

                if (values.yMirror)
                {
                    position.y = container.y - eSize.h; return;
                }
                if (!values.yMirror)
                {
                    position.y = container.height + container.y; return;
                }

                /*
                 * position.y = parent.geometry.tabContent.rect.height;
                 * if (values.yMirror) { position.y = parent.geometry.tabBody.rect.height - eSize.h - position.y; }
                 * return;
                 *
                 */
            }

            //Yrel
            if (values.RelY)
            {
                position.y = values.y * parent.geometry.tabContainer.rect.height;
                if (values.yMirror)
                {
                    position.y = parent.geometry.tabBody.rect.height - eSize.h - position.y;
                }
                return;
            }

            //YLIteral
            position.y = values.y;
            if (values.yMirror)
            {
                position.y = parent.geometry.tabBody.rect.height - eSize.h - position.y;
            }
            return;
        }
        private void SetX(Size eSize)
        {
            //Values from component or branch
            SubType.PositionGeneric values = componentValues;
            if (values.xFollowBranch || branchValues.xFollowBranch)
            {
                values = branchValues;
            }
            // if Yfill X set in SetY
            if (values.YFill)
            {
                return;
            }


            //XStick
            if (values.xStick != SubType.PositionGeneric.xstick.None)
            {
                setXStick(eSize);
                if (values.xMirror)
                {
                    position.x = parent.geometry.tabBody.rect.width - eSize.w - position.x;
                }
                return;
            }


            //XFill
            if (values.XFill)   // all children must have same size



            {
                int pW = (int)parent.geometry.tabBody.rect.width;
                //int eW = (int)eSize.w;
                int eW = (int)eSize.w;
                int elementCountByRow = pW / eW;
                position.x = eSize.w * ((index) % elementCountByRow);
                position.y = eSize.h * ((index) / elementCountByRow);
                if (values.xMirror)
                {
                    position.x = parent.geometry.tabBody.rect.width - eSize.w - position.x;
                }
                if (values.yMirror)
                {
                    position.y = parent.geometry.tabBody.rect.height - eSize.h - position.y;
                }
                return;
            }

            //Xstack
            if (values.XStack)
            {
                int index        = _ele.transform.GetSiblingIndex();
                int brotherCount = _ele.transform.parent.childCount;
                int i            = 0;
                if (index > 0)
                {
                    i = index - 1;
                }

                TabComponent      brotherTab      = _ele.transform.parent.GetChild(i).GetComponent <TabComponent>();
                ButtonComponent   brotherButton   = _ele.transform.parent.GetChild(i).GetComponent <ButtonComponent>();
                TextareaComponent brotherTextarea = _ele.transform.parent.GetChild(i).GetComponent <TextareaComponent>();

                Rect container = new Rect(0, 0, 0, 0);

                if (brotherTab != null)
                {
                    container = brotherTab.tab.geometry.tabContainer.rect;
                }
                if (brotherButton != null)
                {
                    container = brotherButton.button.geometry.buttonBody.rect;
                }
                if (brotherTextarea != null)
                {
                    container = brotherTextarea.textarea.geometry.textareaBody.rect;
                }

                if (values.xMirror)
                {
                    position.x = container.x - eSize.w; return;
                }
                if (!values.xMirror)
                {
                    position.x = container.width + container.x; return;
                }
            }

            //x rel
            if (values.RelX)
            {
                position.x = values.x * parent.geometry.tabContainer.rect.width;
                if (values.xMirror)
                {
                    position.x = parent.geometry.tabBody.rect.width - eSize.w - position.x;
                }
                return;
            }

            //x literal

            position.x = values.x;
            if (values.xMirror)
            {
                position.x = parent.geometry.tabBody.rect.width - eSize.w - position.x;
            }
            return;
        }