コード例 #1
0
        public void DisassociateTagVerify(AssociateTagData input)
        {
            int i = 0;

            while (i <= 3)
            {
                AssociateSettings.NavigateToHierarchyAssociate();
                string[] HierarchyNewPath = new string[i + 1];
                Array.Copy(input.InputData.HierarchyNodePath, HierarchyNewPath, i + 1);
                Assert.IsTrue(AssociateSettings.SelectHierarchyNodePath(HierarchyNewPath));
                //AssociateSettings.SelectHierarchyNode(input.InputData.HierarchyNodePath[i]);
                //Navigate to system dimension node and disassociate ptag
                //Select one hierarchy building node, select a associated tag and click  '解除关联'  button.
                AssociateSettings.FocusOnTag(input.InputData.TagNames[i]);
                AssociateSettings.ClickDisassociateButton(input.InputData.TagNames[i]);
                JazzMessageBox.LoadingMask.WaitLoading();
                TimeManager.ShortPause();
                // It disappears from the associated grid and it appears in the unassociated grid;
                Assert.IsFalse(AssociateSettings.IsTagOnAssociatedGridView(input.InputData.TagNames[i]));
                AssociateSettings.ClickAssociateTagButton();
                JazzMessageBox.LoadingMask.WaitSubMaskLoading();
                TimeManager.MediumPause();
                Assert.IsTrue(AssociateSettings.IsTagOnAssociatedGridView(input.InputData.TagNames[i]));
                //Associate this tag again
                AssociateSettings.CheckedTag(input.InputData.TagNames[i]);
                AssociateSettings.ClickAssociateButton();
                JazzMessageBox.LoadingMask.WaitLoading();
                TimeManager.MediumPause();
                Assert.IsTrue(AssociateSettings.IsTagOnAssociatedGridView(input.InputData.TagNames[i]));
                AssociateSettings.ClickAssociateTagButton();
                JazzMessageBox.LoadingMask.WaitSubMaskLoading();
                TimeManager.MediumPause();
                Assert.IsFalse(AssociateSettings.IsTagOnAssociatedGridView(input.InputData.TagNames[i]));
                AssociateSettings.ClickCancelButton();
                JazzMessageBox.LoadingMask.WaitSubMaskLoading();
                TimeManager.MediumPause();
                //Go to Energy Usage Analysis, select above hierarchy node then select ‘全部数据点’ try to find the above tag.

                AssociateSettings.NavigateToEnergyAnalysis();
                JazzFunction.EnergyAnalysisPanel.SelectHierarchy(HierarchyNewPath);
                JazzFunction.EnergyAnalysisPanel.SwitchTagTab(TagTabs.HierarchyTag);
                TimeManager.ShortPause();
                JazzFunction.EnergyAnalysisPanel.WaitTagListAppear(10);
                TimeManager.LongPause();
                Assert.IsTrue(JazzFunction.EnergyAnalysisPanel.IsTagOnListByName(input.InputData.TagNames[i]));

                i++;
            }
        }
コード例 #2
0
        public void DeleteandVerifyEverywhere(AreaDimensionData input)
        {
            //Select a Building node.
            HierarchySettings.SelectHierarchyNodePath(input.InputData.HierarchyNodePath);
            TimeManager.MediumPause();

            AreaSettings.NavigateToAreaDimensionSetting();
            AreaSettings.SelectAreaDimensionNodePath(input.InputData.AreaNodePath);
            TimeManager.MediumPause();

            AreaSettings.ClickDeleteButton();
            TimeManager.ShortPause();
            //Verify that message box popup for confirm delete
            string msgText = JazzMessageBox.MessageBox.GetMessage();

            Assert.IsTrue(msgText.Contains(input.ExpectedData.Messages[0]));
            Assert.IsTrue(msgText.Contains(input.ExpectedData.Messages[1]));
            AreaSettings.ConfirmErrorMsgBox();
            TimeManager.ShortPause();

            //can't delete when area have associated tags
            string msgText2 = JazzMessageBox.MessageBox.GetMessage();

            Assert.IsTrue(msgText2.Contains(input.ExpectedData.Messages[2]));
            AreaSettings.OKErrorMsgBox();
            TimeManager.ShortPause();

            //Disassociated tag and delete area node again
            AssociateSettings.NavigateToAreaDimensionAssociate();
            TimeManager.ShortPause();
            AreaSettings.SelectAreaDimensionNodePath(input.InputData.AreaNodePath);
            TimeManager.ShortPause();

            AssociateSettings.FocusOnTag(input.InputData.TagName);
            TimeManager.ShortPause();
            AssociateSettings.ClickDisassociateButton(input.InputData.TagName);
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            //Delete again
            HierarchySettings.SelectHierarchyNodePath(input.InputData.HierarchyNodePath);
            TimeManager.MediumPause();

            AreaSettings.NavigateToAreaDimensionSetting();
            AreaSettings.SelectAreaDimensionNodePath(input.InputData.AreaNodePath);
            TimeManager.MediumPause();

            AreaSettings.ClickDeleteButton();
            TimeManager.ShortPause();
            //Verify that message box popup for confirm delete
            string msgText3 = JazzMessageBox.MessageBox.GetMessage();

            Assert.IsTrue(msgText3.Contains(input.ExpectedData.Messages[0]));
            Assert.IsTrue(msgText3.Contains(input.ExpectedData.Messages[1]));
            AreaSettings.ConfirmErrorMsgBox();
            TimeManager.ShortPause();

            //1. Check  on AssociationAreaDimension
            JazzFunction.Navigator.NavigateToTarget(NavigationTarget.AssociationAreaDimension);
            Assert.IsFalse(AreaSettings.SelectAreaDimensionNodePath(input.ExpectedData.AreaNodePath));
            TimeManager.MediumPause();

            //2. Energy Analysis area node added
            JazzFunction.Navigator.NavigateToTarget(NavigationTarget.EnergyAnalysis);
            TimeManager.LongPause();
            JazzFunction.EnergyAnalysisPanel.SelectHierarchy(input.InputData.HierarchyNodePath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            JazzFunction.EnergyAnalysisPanel.SwitchTagTab(TagTabs.AreaDimensionTab);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();

            Assert.IsFalse(JazzFunction.EnergyAnalysisPanel.SelectAreaDimension(input.ExpectedData.AreaNodePath));
            TimeManager.MediumPause();
        }
コード例 #3
0
        public void DeleteNodeWithTags(HierarchyData input)
        {
            string[] Messages = { "无法删除层级节点\"OrgWithTags001\"。请先删除该节点下的所有数据点关联关系。", "删除层级节点\"OrgWithTags001\"吗?您将同时删除层级节点下所有的信息和仪表盘。" };

            //Select one leaf node
            HierarchySettings.SelectHierarchyNodePath(input.InputData.HierarchyNodePath);
            HierarchySettings.ClickDeleteButton();
            TimeManager.ShortPause();

            //Verify that message box popup for can't delete
            string msgText = HierarchySettings.GetMessageText();

            Assert.IsTrue(msgText.Contains(Messages[0]));
            TimeManager.ShortPause();

            //confirm message box
            HierarchySettings.ConfirmCreateOKMagBox();
            TimeManager.ShortPause();

            //Disassociated tags then delete it again
            AssociateSettings.NavigateToHierarchyAssociate();
            TimeManager.ShortPause();

            AssociateSettings.FocusOnTag(input.InputData.TagNames[0]);
            TimeManager.ShortPause();
            AssociateSettings.ClickDisassociateButton(input.InputData.TagNames[0]);
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            AssociateSettings.FocusOnTag(input.InputData.TagNames[1]);
            TimeManager.ShortPause();
            AssociateSettings.ClickDisassociateButton(input.InputData.TagNames[1]);
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            HierarchySettings.NavigatorToHierarchySetting();
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.LongPause();

            HierarchySettings.SelectHierarchyNodePath(input.InputData.HierarchyNodePath);
            HierarchySettings.ClickDeleteButton();
            TimeManager.ShortPause();

            //Verify that message box popup for can't delete
            string msgText1 = HierarchySettings.GetMessageText();

            Assert.IsTrue(msgText1.Contains(Messages[1]));
            TimeManager.ShortPause();

            //confirm message box
            HierarchySettings.ConfirmErrorMsgBox();
            TimeManager.ShortPause();

            //Verify the node has been deleted
            Assert.IsFalse(HierarchySettings.SelectHierarchyNodePath(input.InputData.HierarchyNodePath));

            //verify the associated tags are on disassociated list
            JazzFunction.Navigator.NavigateToTarget(NavigationTarget.AssociationHierarchy);
            Assert.IsFalse(JazzFunction.AssociateSettings.SelectHierarchyNodePath(input.InputData.HierarchyNodePath));
            JazzFunction.AssociateSettings.SelectHierarchyNode(input.ExpectedData.HierarchyNodePath[0]);
            //.SelectHierarchyNodePath(input.ExpectedData.HierarchyNodePath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            JazzFunction.AssociateSettings.ClickAssociateTagButton();
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            Assert.IsTrue(JazzFunction.AssociateSettings.IsTagOnAssociatedGridView(input.InputData.TagNames[0]));
            Assert.IsTrue(JazzFunction.AssociateSettings.IsTagOnAssociatedGridView(input.InputData.TagNames[1]));
        }