示例#1
0
        public void IndustryBenchmarkButtonUnavailable(UnitIndicatorData input)
        {
            //select Carbon/Cost 总览
            UnitKPIPanel.SelectHierarchy(input.InputData.Hierarchies[0]);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.LongPause();
            EnergyViewToolbar.SelectFuncModeConvertTarget(FuncModeConvertTarget.Cost);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.LongPause();
            UnitKPIPanel.SelectCommodityUnitCost();
            TimeManager.LongPause();

            //行业基准值 button is disale
            Assert.IsFalse(IndustryConvertTargetButton.IsEnabled());
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            //Unit indicator chart display without benchmark chart
            Assert.IsFalse(UnitKPIPanel.IsLegendItemExists(input.InputData.UnitIndicatorLegend[0].BenchmarkValue));

            //select Cost, not select any commodity
            UnitKPIPanel.UnSelectSingleCommodityUnitCost();
            Assert.IsTrue(IndustryConvertTargetButton.IsEnabled());
            TimeManager.MediumPause();

            //园区节点
            UnitKPIPanel.SelectHierarchy(input.InputData.Hierarchies[1]);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.LongPause();
            EnergyViewToolbar.SelectFuncModeConvertTarget(FuncModeConvertTarget.Cost);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.LongPause();

            //总览
            UnitKPIPanel.SelectCommodityUnitCost();
            TimeManager.LongPause();
            Assert.IsFalse(IndustryConvertTargetButton.IsEnabled());
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            //Verify benchmark line not draw out
            Assert.IsFalse(UnitKPIPanel.IsLegendItemExists(input.InputData.UnitIndicatorLegend[0].BenchmarkValue));

            //介质单项
            UnitKPIPanel.SelectSingleCommodityUnitCost(input.InputData.Commodity[0]);
            TimeManager.LongPause();
            Assert.IsFalse(IndustryConvertTargetButton.IsEnabled());
            TimeManager.MediumPause();
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();
            Assert.IsFalse(UnitKPIPanel.IsLegendItemExists(input.InputData.UnitIndicatorLegend[0].BenchmarkValue));

            //区域数据点
            UnitKPIPanel.SelectHierarchy(input.InputData.Hierarchies[2]);
            EnergyViewToolbar.SelectFuncModeConvertTarget(FuncModeConvertTarget.Cost);
            UnitKPIPanel.SwitchTagTab(TagTabs.AreaDimensionTab);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            UnitKPIPanel.SelectAreaDimension(input.InputData.AreaDimensionPath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            UnitKPIPanel.SelectCommodityUnitCost();
            TimeManager.LongPause();
            Assert.IsFalse(IndustryConvertTargetButton.IsEnabled());
            TimeManager.LongPause();

            //Different commodities, benchmark button is not enable
            EnergyViewToolbar.SelectFuncModeConvertTarget(FuncModeConvertTarget.Energy);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            UnitKPIPanel.SwitchTagTab(TagTabs.HierarchyTag);
            UnitKPIPanel.CheckTag(input.InputData.tagNames[0]);
            UnitKPIPanel.CheckTag(input.InputData.tagNames[1]);
            UnitKPIPanel.CheckTag(input.InputData.tagNames[2]);
            Assert.IsTrue(HomePagePanel.GetPopNotesValue().Contains(input.ExpectedData.popupNotes[2]));
            TimeManager.LongPause();
            Assert.IsFalse(IndustryConvertTargetButton.IsEnabled());

            //Same commodity, benchmark line can be draw out.
            UnitKPIPanel.UncheckTag(input.InputData.tagNames[0]);
            Assert.IsTrue(IndustryConvertTargetButton.IsEnabled());
            EnergyViewToolbar.SelectIndustryConvertTarget(input.InputData.Industries[0]);
            TimeManager.ShortPause();
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();
            Assert.IsTrue(UnitKPIPanel.IsLegendItemExists(input.InputData.UnitIndicatorLegend[0].BenchmarkValue));

            //Close benchmark legend,  行业基准值 change to show 行业基准值.
            UnitKPIPanel.CloseLegendItem(input.InputData.UnitIndicatorLegend[0].BenchmarkValue);
            TimeManager.ShortPause();
            Assert.AreEqual(input.ExpectedData.IndustryValue, IndustryConvertTargetButton.GetText());

            //None, 寒冷地区酒店,全部区域酒店,寒冷地区全行业from dropdown list.
            UnitKPIPanel.UncheckTag(input.InputData.tagNames[1]);
            Assert.AreEqual(input.ExpectedData.Industries, EnergyViewToolbar.GetBenchmarkMenulist("Energy"));
            TimeManager.MediumPause();
            UnitKPIPanel.UncheckTag(input.InputData.tagNames[2]);
            TimeManager.MediumPause();
            Assert.AreEqual(input.ExpectedData.Industries, EnergyViewToolbar.GetBenchmarkMenulist("Energy"));
            TimeManager.MediumPause();

            //Change another building, The button is enabled even if there isn't any tags selected.
            UnitKPIPanel.SelectHierarchy(input.InputData.Hierarchies[0]);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.LongPause();
            Assert.IsTrue(IndustryConvertTargetButton.IsEnabled());
            TimeManager.LongPause();

            //Select multiple tags Labellingtag2 from BuildingLabellingtag2
            EnergyViewToolbar.SelectTagModeConvertTarget(TagModeConvertTarget.MultipleHierarchyTag);
            TimeManager.LongPause();
            MultiHieCompareWindow.SelectHierarchyNode(input.InputData.MultipleHierarchyAndtags[0].HierarchyPath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.ShortPause();
            MultiHieCompareWindow.SwitchTagTab(TagTabs.HierarchyTag);
            MultiHieCompareWindow.CheckTag(input.InputData.MultipleHierarchyAndtags[0].TagsName[0]);
            TimeManager.ShortPause();
            MultiHieCompareWindow.ClickConfirmButton();
            TimeManager.LongPause();
            Assert.IsTrue(IndustryConvertTargetButton.IsEnabled());

            UnitKPIPanel.ClickMultipleHierarchyAddTagsButton();
            TimeManager.ShortPause();
            MultiHieCompareWindow.ClickDeleteXButton(input.InputData.MultiSelectedHiearchyPath[0], input.InputData.tagNames[4]);
            TimeManager.ShortPause();

            //选择系统数据点, check Benchamrk dropdown list
            MultiHieCompareWindow.SelectHierarchyNode(input.InputData.MultipleHierarchyAndtags[2].HierarchyPath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.LongPause();
            MultiHieCompareWindow.SwitchTagTab(TagTabs.SystemDimensionTab);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            MultiHieCompareWindow.SelectSystemDimension(input.InputData.MultipleHiearchyPath[0]);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();
            MultiHieCompareWindow.CheckTag(input.InputData.tagNames[3]);
            MultiHieCompareWindow.ClickConfirmButton();
            TimeManager.LongPause();
            Assert.IsTrue(IndustryConvertTargetButton.IsEnabled());
            //Assert.AreEqual(input.ExpectedData.Industries[0], EnergyViewToolbar.GetBenchmarkMenulist("Energy"));

            //Unselect NancyCustomer1, tag V9_BuildingBC
            UnitKPIPanel.ClickMultipleHierarchyAddTagsButton();
            TimeManager.LongPause();
            MultiHieCompareWindow.ClickDeleteXButton(input.InputData.MultiSelectedHiearchyPath[1], input.InputData.tagNames[3]);
            TimeManager.LongPause();

            //Go to Multiple hierarchy node comparation mode. check Labellingtag2 from Buildinglabelling2. Select 1 Labellingtag3 tag from Buildinglabelling3 and 确定.
            MultiHieCompareWindow.SelectHierarchyNode(input.InputData.MultipleHierarchyAndtags[0].HierarchyPath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.ShortPause();
            MultiHieCompareWindow.SwitchTagTab(TagTabs.HierarchyTag);
            MultiHieCompareWindow.CheckTag(input.InputData.MultipleHierarchyAndtags[0].TagsName[0]);
            TimeManager.ShortPause();
            MultiHieCompareWindow.SelectHierarchyNode(input.InputData.MultipleHierarchyAndtags[1].HierarchyPath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.ShortPause();
            MultiHieCompareWindow.SwitchTagTab(TagTabs.HierarchyTag);
            MultiHieCompareWindow.CheckTag(input.InputData.MultipleHierarchyAndtags[1].TagsName[0]);
            TimeManager.ShortPause();
            MultiHieCompareWindow.ClickConfirmButton();
            TimeManager.LongPause();
            EnergyViewToolbar.SelectIndustryConvertTarget(input.InputData.Industries[2]);
            TimeManager.LongPause();

            //Click "删除所有" and 确定
            EnergyViewToolbar.SelectMoreOption(EnergyViewMoreOption.DeleteAll);
            TimeManager.MediumPause();
            Assert.IsTrue(JazzMessageBox.MessageBox.GetMessage().Contains(input.ExpectedData.ClearAllMessage));
            JazzMessageBox.MessageBox.Clear();
            TimeManager.LongPause();
            Assert.IsFalse(IndustryConvertTargetButton.IsEnabled());
            TimeManager.LongPause();

            //验证多层级不同介质
            UnitKPIPanel.ClickMultipleHierarchyAddTagsButton();
            TimeManager.LongPause();
            MultiHieCompareWindow.SelectHierarchyNode(input.InputData.MultipleHierarchyAndtags[3].HierarchyPath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.ShortPause();
            MultiHieCompareWindow.SwitchTagTab(TagTabs.HierarchyTag);
            MultiHieCompareWindow.CheckTag(input.InputData.MultipleHierarchyAndtags[3].TagsName[0]);
            TimeManager.ShortPause();

            MultiHieCompareWindow.SelectHierarchyNode(input.InputData.MultipleHierarchyAndtags[1].HierarchyPath);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.ShortPause();
            MultiHieCompareWindow.SwitchTagTab(TagTabs.HierarchyTag);
            MultiHieCompareWindow.CheckTag(input.InputData.MultipleHierarchyAndtags[1].TagsName[0]);
            TimeManager.ShortPause();

            MultiHieCompareWindow.ClickConfirmButton();
            TimeManager.LongPause();
            Assert.IsFalse(IndustryConvertTargetButton.IsEnabled());
            TimeManager.LongPause();

            //切换到Ratio验证ConvertTargetButton status
            RadioPanel.NavigateToRatio();
            TimeManager.MediumPause();
            Assert.AreEqual(input.ExpectedData.IndustryValue, IndustryConvertTargetButton.GetText());
            TimeManager.LongPause();
        }
示例#2
0
        public void ViewConsumptionUnitIndicator01(UnitIndicatorData input)
        {
            //Go to Function Unit indicator. Select the BuildingBC from Hierarchy Tree. Click Function Type button, select Energy Consumption.
            UnitKPIPanel.SelectHierarchy(input.InputData.Hierarchies[0]);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();

            Assert.AreEqual(input.ExpectedData.UnitTypeValue, EnergyViewToolbar.GetUnitTypeButtonText());
            Assert.AreEqual(input.ExpectedData.IndustryValue, EnergyViewToolbar.GetIndustryButtonText());

            //Select 1 tag V(1), time range="今年", to display trend chart view.(No population property on last year)
            UnitKPIPanel.CheckTag(input.InputData.tagNames[0]);
            TimeManager.ShortPause();
            EnergyViewToolbar.SelectMoreOption(EnergyViewMoreOption.ThisYear);
            TimeManager.ShortPause();
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            Assert.IsTrue(UnitKPIPanel.IsTrendChartDrawn());
            //Assert.AreEqual(1, UnitKPIPanel.GetTrendChartLines());

            EnergyViewToolbar.View(EnergyViewType.List);
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            EnergyAnalysis.ClickDisplayStep(DisplayStep.Month);
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            //check on data view
            UnitKPIPanel.ExportExpectedDataTableToExcel(input.ExpectedData.expectedFileName[0], DisplayStep.Default);
            TimeManager.MediumPause();
            UnitKPIPanel.CompareDataViewUnitIndicator(input.ExpectedData.expectedFileName[0], input.InputData.failedFileName[0]);

            //Select Unit=单位面积 and view data.
            EnergyViewToolbar.SelectUnitTypeConvertTarget(UnitTypeConvertTarget.UnitArea);
            EnergyViewToolbar.View(EnergyViewType.List);
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            EnergyAnalysis.ClickDisplayStep(DisplayStep.Month);
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            UnitKPIPanel.ExportExpectedDataTableToExcel(input.ExpectedData.expectedFileName[1], DisplayStep.Default);
            TimeManager.MediumPause();
            UnitKPIPanel.CompareDataViewUnitIndicator(input.ExpectedData.expectedFileName[1], input.InputData.failedFileName[0]);

            EnergyViewToolbar.View(EnergyViewType.Line);
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            Assert.IsTrue(UnitKPIPanel.IsTrendChartDrawn());
            //Assert.AreEqual(1, UnitKPIPanel.GetTrendChartLines());

            //4 legand s//how include 能耗/单位面积; 目标值/单位面积; 基准值/单位面积 and 能耗(Gray out).
            Assert.IsTrue(UnitKPIPanel.IsLineLegendItemShown(input.InputData.UnitIndicatorLegend[0].CaculationValue));
            Assert.IsTrue(UnitKPIPanel.IsLineLegendItemShown(input.InputData.UnitIndicatorLegend[0].TargetValue));
            Assert.IsTrue(UnitKPIPanel.IsLineLegendItemShown(input.InputData.UnitIndicatorLegend[0].BaselineValue));
            Assert.IsFalse(UnitKPIPanel.IsLineLegendItemShown(input.InputData.UnitIndicatorLegend[0].OriginalValue));
            Assert.IsTrue(UnitKPIPanel.IsLegendItemExists(input.InputData.UnitIndicatorLegend[0].OriginalValue));

            /*tspan 找不到原始的那个数据点了;而且28版本的chrome对legend的支持不好,暂时跳过
             * //能耗 chart default hiden. When click the gray out 能耗 legand, show 1 more能耗 chart.
             * UnitKPIPanel.ShowLineCurveLegend(input.InputData.UnitIndicatorLegend[0].OriginalValue);
             * TimeManager.ShortPause();
             * Assert.IsTrue(UnitKPIPanel.IsTrendChartDrawn());
             */

            //Select BuildingBAD and check V(11), Unit= 单位人口 to display trend chart view.
            UnitKPIPanel.SelectHierarchy(input.InputData.Hierarchies[1]);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();

            EnergyViewToolbar.SelectUnitTypeConvertTarget(UnitTypeConvertTarget.UnitPopulation);
            UnitKPIPanel.CheckTag(input.InputData.tagNames[3]);
            TimeManager.ShortPause();
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            //Assert.IsTrue(HomePagePanel.GetPopNotesValue().Contains(input.ExpectedData.popupNotes[0]));

            //Change time range to 2012/01-2012/03, Unit= 单位人口 to view chart.
            EnergyViewToolbar.SetDateRange(new DateTime(2012, 1, 1), new DateTime(2012, 3, 1));
            TimeManager.ShortPause();
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();
            TimeManager.ShortPause();

            //Assert.IsTrue(HomePagePanel.GetPopNotesValue().Contains(input.ExpectedData.popupNotes[0]));
            Assert.AreEqual("2012-01-01", EnergyViewToolbar.GetStartDate());
            Assert.AreEqual("2012-03-01", EnergyViewToolbar.GetEndDate());

            //Select the BuildingBC from Hierarchy Tree.time range="去年". Select multiple tag V(1)+V(2) +V(3) to display trend chart view
            UnitKPIPanel.SelectHierarchy(input.InputData.Hierarchies[0]);
            JazzMessageBox.LoadingMask.WaitSubMaskLoading();
            TimeManager.MediumPause();

            UnitKPIPanel.CheckTag(input.InputData.tagNames[0]);
            UnitKPIPanel.CheckTag(input.InputData.tagNames[1]);
            UnitKPIPanel.CheckTag(input.InputData.tagNames[2]);
            TimeManager.ShortPause();
            //Assert.IsTrue(HomePagePanel.GetPopNotesValue().Contains(input.ExpectedData.popupNotes[1]));
            EnergyViewToolbar.SelectMoreOption(EnergyViewMoreOption.LastYear);
            TimeManager.ShortPause();
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();
            //Assert.IsTrue(HomePagePanel.GetPopNotesValue().Contains(input.ExpectedData.popupNotes[0]));
            Assert.IsTrue(UnitKPIPanel.IsTrendChartDrawn());
            //Assert.AreEqual(3, UnitKPIPanel.GetTrendChartLines());

            //2 legend pereach tag include 能耗/单位面积; and 能耗(Gray out).)
            Assert.IsTrue(UnitKPIPanel.IsLineLegendItemShown(input.ExpectedData.UnitIndicatorLegend[0].CaculationValue));
            Assert.IsFalse(UnitKPIPanel.IsLineLegendItemShown(input.ExpectedData.UnitIndicatorLegend[0].OriginalValue));
            Assert.IsTrue(UnitKPIPanel.IsLineLegendItemShown(input.ExpectedData.UnitIndicatorLegend[1].CaculationValue));
            Assert.IsFalse(UnitKPIPanel.IsLineLegendItemShown(input.ExpectedData.UnitIndicatorLegend[1].OriginalValue));
            Assert.IsTrue(UnitKPIPanel.IsLineLegendItemShown(input.ExpectedData.UnitIndicatorLegend[2].CaculationValue));
            Assert.IsFalse(UnitKPIPanel.IsLineLegendItemShown(input.ExpectedData.UnitIndicatorLegend[2].OriginalValue));

            //Change different time range
            //a. 2012/07/01 3:30-2012/07/01 15:00 hour
            var ManualTimeRange = input.InputData.ManualTimeRange;

            EnergyViewToolbar.SetDateRange(ManualTimeRange[0].StartDate, ManualTimeRange[0].EndDate);
            EnergyViewToolbar.SetTimeRange(ManualTimeRange[0].StartTime, ManualTimeRange[0].EndTime);
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            Assert.IsTrue(EnergyAnalysis.IsDisplayStepPressed(DisplayStep.Hour));

            //b. 2012/07/01 3:30-2012/07/03 23:30 day
            EnergyViewToolbar.SetDateRange(ManualTimeRange[1].StartDate, ManualTimeRange[1].EndDate);
            EnergyViewToolbar.SetTimeRange(ManualTimeRange[1].StartTime, ManualTimeRange[1].EndTime);
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            Assert.IsTrue(EnergyAnalysis.IsDisplayStepDisplayed(DisplayStep.Day));
            Assert.IsTrue(EnergyAnalysis.IsDisplayStepPressed(DisplayStep.Hour));

            //c. 2012/07/10-2012/08/05 week
            EnergyViewToolbar.SetDateRange(ManualTimeRange[2].StartDate, ManualTimeRange[2].EndDate);
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            Assert.IsTrue(EnergyAnalysis.IsDisplayStepDisplayed(DisplayStep.Week));
            Assert.IsTrue(EnergyAnalysis.IsDisplayStepPressed(DisplayStep.Day));

            //d. 2012/01/01-2012/12/31=lastyear month
            EnergyViewToolbar.SetDateRange(ManualTimeRange[3].StartDate, ManualTimeRange[3].EndDate);
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            Assert.IsTrue(EnergyAnalysis.IsDisplayStepPressed(DisplayStep.Month));

            //e. 2011/01/01-2013/05/30 year
            EnergyViewToolbar.SetDateRange(ManualTimeRange[4].StartDate, ManualTimeRange[4].EndDate);
            EnergyViewToolbar.ClickViewButton();
            JazzMessageBox.LoadingMask.WaitChartMaskerLoading();
            TimeManager.MediumPause();

            Assert.IsTrue(EnergyAnalysis.IsDisplayStepPressed(DisplayStep.Month));
            Assert.IsTrue(EnergyAnalysis.IsDisplayStepDisplayed(DisplayStep.Year));
        }