Exemple #1
0
        public void AddCustomizedLabelingValidInput(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //Input valid Labelling name.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);
            TimeManager.MediumPause();

            //Change to select KPI type.
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPIType);

            CustomizedLabellingSettings.FillInCommentTextField(input.InputData.Comments);
            TimeManager.MediumPause();

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[0][num].LabellingLeftValue);
            }
            //Save
            CustomizedLabellingSettings.ClickSaveButton();
            JazzMessageBox.LoadingMask.WaitLoading(15);
            TimeManager.LongPause();

            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Comments, CustomizedLabellingSettings.GetCommentTextFieldValue());
        }
        public void DeleteCustomizedLabelingValid01(CustomizedLabellingSettingData input)
        {
            //Click a labeling from list
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[0]);
            Assert.AreEqual(input.ExpectedData.CommonNames[0], CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, input.InputData.Commodity);
            Assert.AreEqual(input.ExpectedData.LabellingLevel, input.InputData.LabellingLevel);


            //click 删除 button.
            CustomizedLabellingSettings.ClickDeleteButton();
            TimeManager.LongPause();

            //After click confirmation 确定 button.
            JazzMessageBox.MessageBox.Delete();
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.ShortPause();

            //Go to labeling list to check.
            // Deleted labeling can't display in labeling list correctly.
            Assert.IsFalse(CustomizedLabellingSettings.IslabelingNameExist(input.InputData.CommonNames[0]));

            //Go to other page (e.g. HomePage) then back to customized labeling page to view.
            JazzFunction.Navigator.NavigateToTarget(NavigationTarget.HomePage);
            TimeManager.LongPause();
            TimeManager.LongPause();
            CustomizedLabellingSettings.NavigatorToCustomizedLabelling();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //· The labeling still Not display in labeling list correctly.
            Assert.IsFalse(CustomizedLabellingSettings.IslabelingNameExist(input.InputData.CommonName));
        }
Exemple #3
0
        public void AddCustomizedLabellingDuplicatedName(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //Input all fields :CommonName="自定义能效标识1",Commdodity=电,能效标识级别=4,KPI type=单位人口.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);
            TimeManager.MediumPause();
            CustomizedLabellingSettings.SelectCommodityComboBox(input.InputData.Commodity);
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPIType);
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevel);

            //check labelingGrade count
            Assert.AreEqual(Convert.ToUInt32(input.InputData.LabellingLevelValue), CustomizedLabellingSettings.GetLabellingGradeCount());

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[0][num].LabellingLeftValue);
            }

            //Click Save button.
            CustomizedLabellingSettings.ClickSaveButton();
            TimeManager.LongPause();
            TimeManager.LongPause();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //Red line and error message display at 名称.
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetLabellingNameInvalidTips());
        }
Exemple #4
0
        public void AddCustomizedLabelingDefault(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();

            //Input valid Labelling name.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);

            //check labelingGrade Firstlabel&Lastlabel.
            Assert.AreEqual(input.ExpectedData.Firstlabel, CustomizedLabellingSettings.GetLabellingGradeFirstLabel());
            Assert.AreEqual(input.ExpectedData.Lastlabel, CustomizedLabellingSettings.GetLabellingGradeLastLabel());

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //check labelingGrade count
            int count = Convert.ToInt32(input.InputData.LabellingLevelValue);

            Assert.AreEqual(count, CustomizedLabellingSettings.GetLabellingGradeCount());

            //这里有个问题,对于中文版,有些单位还是习惯性的用缩写英文表示,没有显示成中文,这个后续会和UI确认
            //check UOM
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue.ToString()); num++)
            {
                Assert.AreEqual(input.ExpectedData.UOM, CustomizedLabellingSettings.GetLabellingUOMValue(num + 1));
            }

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[0][num].LabellingLeftValue);
            }

            //Save
            CustomizedLabellingSettings.ClickSaveButton();
            TimeManager.LongPause();

            //Go to view status display Labelling successfully the same as before save.
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, CustomizedLabellingSettings.GetCommodityComboBoxValue());
            Assert.AreEqual(input.ExpectedData.KPIType, CustomizedLabellingSettings.GetKPITypeComboBoxValue());
            Assert.AreEqual(input.ExpectedData.LabellingLevel, CustomizedLabellingSettings.GetLabellingLevelComboBoxValue());

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //Check lalelling level's right value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }

            //The labelling name/create user/create time display in labelling grid.
            Assert.IsTrue(CustomizedLabellingSettings.IslabelingNameExist(input.ExpectedData.CommonName));
        }
Exemple #5
0
        public void ModifyCustomizedLabellingWithoutChange(CustomizedLabellingSettingData input)
        {
            //Click an exist labeling from list and click 修改 button.
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonName);
            TimeManager.LongPause();

            //Click Save button.
            CustomizedLabellingSettings.ClickSaveButton();
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            //· labeling save to labeling list successfully without modified any fields.
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, CustomizedLabellingSettings.GetCommodityComboBoxValue());
            Assert.AreEqual(input.ExpectedData.KPIType, CustomizedLabellingSettings.GetKPITypeComboBoxValue());
            Assert.AreEqual(input.ExpectedData.LabellingLevel, CustomizedLabellingSettings.GetLabellingLevelComboBoxValue());

            //check labelingGrade Firstlabel&Lastlabel.
            Assert.AreEqual(input.ExpectedData.Firstlabel, CustomizedLabellingSettings.GetLabellingGradeFirstLabel());
            Assert.AreEqual(input.ExpectedData.Lastlabel, CustomizedLabellingSettings.GetLabellingGradeLastLabel());

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //check labelingGrade count
            int count = Convert.ToInt32(input.InputData.LabellingLevelValue);

            Assert.AreEqual(count, CustomizedLabellingSettings.GetLabellingGradeCount());

            //这里有个问题,对于中文版,有些单位还是习惯性的用缩写英文表示,没有显示成中文,这个后续会和UI确认
            //Check UOM
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.UOM, CustomizedLabellingSettings.GetLabellingUOMValue(num + 1));
            }

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //Check lalelling level's right value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }
        }
Exemple #6
0
        public void ModifyCustomizedLabellingDuplicatedName(CustomizedLabellingSettingData input)
        {
            //Click an exist labeling from list and click 修改 button.
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[0]);
            TimeManager.LongPause();

            //Change name to the same as exist labelling.Click Save button.
            CustomizedLabellingSettings.ClickModifyButton();
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonNames[1]);
            CustomizedLabellingSettings.ClickSaveButton();
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            //·Redline display at name.
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetLabellingNameInvalidTips());
        }
        public void DeleteCustomizedLabelingCancelled01(CustomizedLabellingSettingData input)
        {
            //Click a labeling from list
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonName);
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, input.InputData.Commodity);
            Assert.AreEqual(input.ExpectedData.LabellingLevel, input.InputData.LabellingLevel);


            //click 删除 button.
            CustomizedLabellingSettings.ClickDeleteButton();
            TimeManager.LongPause();

            //After click confirmation 取消 button.
            CustomizedLabellingSettings.ClickCancelButton();

            //· The labeling still display in labeling list.
            Assert.IsTrue(CustomizedLabellingSettings.IslabelingNameExist(input.InputData.CommonName));


            //click 删除 button.
            CustomizedLabellingSettings.ClickDeleteButton();
            TimeManager.LongPause();

            //After click confirmation "X" button.
            CustomizedLabellingSettings.ClickCloseButton();

            // The labeling still display in labeling list.
            Assert.IsTrue(CustomizedLabellingSettings.IslabelingNameExist(input.InputData.CommonName));

            //Go to other page (e.g. HomePage) then back to customized labeling page to view.
            JazzFunction.Navigator.NavigateToTarget(NavigationTarget.HomePage);
            TimeManager.LongPause();
            TimeManager.LongPause();
            CustomizedLabellingSettings.NavigatorToCustomizedLabelling();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //· The labeling still display in labeling list correctly.
            Assert.IsTrue(CustomizedLabellingSettings.IslabelingNameExist(input.InputData.CommonName));
        }
Exemple #8
0
        public void AddIllegalCustomizedLabelling(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //Input valid Labelling name.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);
            TimeManager.MediumPause();

            CustomizedLabellingSettings.FillInCommentTextField(input.InputData.Comments);
            TimeManager.MediumPause();

            CustomizedLabellingSettings.ClickSaveButton();
            TimeManager.LongPause();

            //Verify that the error message popup and the input field is invalid
            Assert.IsFalse(CustomizedLabellingSettings.IsCommentsInvalid());
            Assert.IsTrue(CustomizedLabellingSettings.IsNameInvalid());
            Assert.IsTrue(CustomizedLabellingSettings.IsNameInvalidMsgCorrect(input.ExpectedData.CommonName));
        }
Exemple #9
0
        public void ModifyCustomizedLabelingInvalid(CustomizedLabellingSettingData input)
        {
            //Click an exist labeling from list and click 修改 button.
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[0]);
            TimeManager.LongPause();

            //Change name to invalid as validation rule.Click Save button.
            CustomizedLabellingSettings.ClickModifyButton();
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonNames[1]);
            CustomizedLabellingSettings.ClickSaveButton();
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            //·Red line and error message display at 名称.
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetLabellingNameInvalidTips());

            // Change labelling levels value fields to invalid as validation rule.
            CustomizedLabellingSettings.FillInLabellingLevelLeftValue(1, input.InputData.LabellingValue[1][0].LabellingLeftValue);
            TimeManager.LongPause();
            Assert.AreEqual(input.ExpectedData.LabellingValue[1][0].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftInvalidMassage(1));
        }
Exemple #10
0
        public void AddCustomizedLabelingValid(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //Input valid Labelling name.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);
            TimeManager.MediumPause();

            //Change Commodity from dropdown list.
            CustomizedLabellingSettings.SelectCommodityComboBox(input.InputData.Commodity);
            TimeManager.MediumPause();

            //Change Uom from dropdown list.
            CustomizedLabellingSettings.SelectUomComboBox(input.InputData.Uom);

            //Select 能效标识级别 from dropdown list.
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevel);

            //check labelingGrade count
            int count = Convert.ToInt32(input.InputData.LabellingLevelValue);

            Assert.AreEqual(count, CustomizedLabellingSettings.GetLabellingGradeCount());

            //Select KPI type=昼夜比.
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPITypes[0]);
            Assert.AreEqual(input.ExpectedData.KPITypes[0], input.InputData.KPITypes[0]);

            //Check AscendingCustomizedLabellingButton is "倒序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetDescendingCustomizedLabellingButton());

            //Change to select KPI type=单位人口.(这里改变以后就直接是正序了,不再是倒序)
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPITypes[1]);

            //check labelingGrade Firstlabel&Lastlabel.
            Assert.AreEqual(input.ExpectedData.Firstlabel, CustomizedLabellingSettings.GetLabellingGradeFirstLabel());
            Assert.AreEqual(input.ExpectedData.Lastlabel, CustomizedLabellingSettings.GetLabellingGradeLastLabel());

            //这里有个问题,对于中文版,有些单位还是习惯性的用缩写英文表示,没有显示成中文,这个后续会和UI确认
            //Check UOM
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue.ToString()); num++)
            {
                Assert.AreEqual(input.ExpectedData.UOM, CustomizedLabellingSettings.GetLabellingUOMValue(num + 1));
            }

            //Input Labelling level A<=5.144.
            CustomizedLabellingSettings.FillInLabellingLevelLeftValue(1, input.InputData.LabellingValue[0][0].LabellingLeftValue);
            TimeManager.LongPause();

            //Input Labelling level C=1000000000.
            CustomizedLabellingSettings.FillInLabellingLevelLeftValue(3, input.InputData.LabellingValue[1][0].LabellingLeftValue);
            TimeManager.LongPause();
            TimeManager.LongPause();

            Assert.AreEqual(input.ExpectedData.LabellingValue[1][0].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftInvalidMassage(3));

            //Input Labelling level C=10.
            CustomizedLabellingSettings.FillInLabellingLevelLeftValue(3, "");
            CustomizedLabellingSettings.FillInLabellingLevelLeftValue(3, input.InputData.LabellingValue[0][2].LabellingLeftValue);
            TimeManager.LongPause();

            //Save
            CustomizedLabellingSettings.ClickSaveButton();
            TimeManager.LongPause();

            //Auto change level B left border=5.14,Auto round level A<=5.14
            Assert.AreEqual(input.ExpectedData.LabellingValue[0][0].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(1));
            Assert.AreEqual(input.ExpectedData.LabellingValue[0][1].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(2));

            //Auto change level B right border=10.
            Assert.AreEqual(input.ExpectedData.LabellingValue[0][1].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(2));

            //Go to view status display Labelling successfully the same as before save.
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, input.InputData.Commodity);
            Assert.AreEqual(input.ExpectedData.Uom, input.InputData.Uom);
            Assert.AreEqual(input.ExpectedData.LabellingLevel, input.InputData.LabellingLevel);
            Assert.AreEqual(input.ExpectedData.KPITypes[1], input.InputData.KPITypes[1]);

            //The labelling name/create user/create time display in labelling grid.
            Assert.IsTrue(CustomizedLabellingSettings.IslabelingNameExist(input.ExpectedData.CommonName));

            //有个bug,现在备注是空的时候不隐藏,每次到这里会失败
            Assert.IsTrue(CustomizedLabellingSettings.IsCommentHidden());
        }
Exemple #11
0
        public void AddCustomizedLabellingChangeLevels(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();

            //Input valid Labelling name.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);

            //Change Commodity from dropdown list.
            CustomizedLabellingSettings.SelectCommodityComboBox(input.InputData.Commodities[0]);

            //Change to select KPI type=单位面积.
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPITypes[0]);

            //Select 能耗标识级别=8 from dropdown list.
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevels[0]);

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //check labelingGrade Firstlabel&Lastlabel.
            Assert.AreEqual(input.ExpectedData.Firstlabels[0], CustomizedLabellingSettings.GetLabellingGradeFirstLabel());
            Assert.AreEqual(input.ExpectedData.Lastlabels[0], CustomizedLabellingSettings.GetLabellingGradeLastLabel());

            //check labelingGrade count
            int count = Convert.ToInt32(input.InputData.LabellingLevelValues[0]);

            Assert.AreEqual(count, CustomizedLabellingSettings.GetLabellingGradeCount());

            //Input Labelling Left Value
            for (int num = 1; num < count; num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[0][num].LabellingLeftValue);
            }

            //Select 能耗标识级别=6 from dropdown list.
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevels[1]);

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[1]); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[1][num].LabellingLeftValue);
            }

            //Change select other KPI type=工休比 from dropdown list.
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPITypes[1]);
            TimeManager.LongPause();


            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[1]); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[3][num].LabellingLeftValue);
            }

            //change to "正序"
            CustomizedLabellingSettings.ClickAscendingCustomizedLabellingButton();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //check the values is "正序"
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[1]); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[2][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //change to "倒序"
            CustomizedLabellingSettings.ClickDescendingCustomizedLabellingButton();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //Save
            CustomizedLabellingSettings.ClickSaveButton();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //Check the 公休比 levels saved successfully.
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonName, input.ExpectedData.ConfigurationUser);
            TimeManager.LongPause();

            //Check lalelling level's left value after saved.
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[3][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //Check lalelling level's right value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }
        }
Exemple #12
0
        public void AddCustomizedLabelingCancelled(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            // Get labelinglist's row count
            int i = CustomizedLabellingSettings.GetCustomizedLabellingListCount();

            //Click Cancel button before input.
            CustomizedLabellingSettings.ClickCancelButton();

            //Cancel and there isn't any labeling added to list.
            int j = CustomizedLabellingSettings.GetCustomizedLabellingListCount();

            Assert.AreEqual(i, j);

            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //Input all fields :CommonName="自定义能效标识2",Commdodity=电,能效标识级别=4,KPI type=单位人口.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);
            TimeManager.MediumPause();
            CustomizedLabellingSettings.SelectCommodityComboBox(input.InputData.Commodity);
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPIType);
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevel);

            //check labelingGrade count
            Assert.AreEqual(Convert.ToUInt32(input.InputData.LabellingLevelValue), CustomizedLabellingSettings.GetLabellingGradeCount());

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[0][num].LabellingLeftValue);
            }

            //Click Cancel button.
            CustomizedLabellingSettings.ClickCancelButton();

            //·Cancel and there isn't any labeling added to list.
            Assert.AreEqual(j, CustomizedLabellingSettings.GetCustomizedLabellingListCount());

            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //· All input field cleared.
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //check Labelling right Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }
        }
Exemple #13
0
        public void AddCustomizedLabellingInvalid(CustomizedLabellingSettingData input)
        {
            //Click "+能效标识" button
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //Click Save button before input.
            CustomizedLabellingSettings.ClickSaveButton();

            //·Red line and error message display at 名称.
            //Red line and error message display at A-E Levels value input fields.
            Assert.AreEqual(input.ExpectedData.CommonNames[1], CustomizedLabellingSettings.GetLabellingNameInvalidTips());
            for (int num = 0; num < Convert.ToUInt32(input.InputData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[1][0].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftInvalidMassage(num + 1));
            }
            for (int num = 1; num < Convert.ToUInt32(input.InputData.LabellingLevelValue) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[1][0].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightInvalidMassage(num + 1));
            }

            //Click Cancel button.Click "+能效标识" button
            CustomizedLabellingSettings.ClickCancelButton();
            CustomizedLabellingSettings.ClickAddCustomizedLabellingButton();
            TimeManager.LongPause();

            //Input all fields :CommonName="自定义能效标识1",Commdodity=电,能效标识级别=4,KPI type=单位人口.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonName);
            TimeManager.MediumPause();
            CustomizedLabellingSettings.SelectCommodityComboBox(input.InputData.Commodity);
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPIType);
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevel);

            //check labelingGrade count
            Assert.AreEqual(Convert.ToUInt32(input.InputData.LabellingLevelValue), CustomizedLabellingSettings.GetLabellingGradeCount());

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[0][num].LabellingLeftValue);
            }

            //Click Save button.
            CustomizedLabellingSettings.ClickSaveButton();

            //· All redline disappeared.The Labelling save successfully.
            Assert.AreEqual(input.ExpectedData.CommonNames[0], CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, input.InputData.Commodity);
            Assert.AreEqual(input.ExpectedData.LabellingLevel, input.InputData.LabellingLevel);
            Assert.AreEqual(input.ExpectedData.KPIType, input.InputData.KPIType);

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //check Labelling right Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValue) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }

            //The labelling name/create user/create time display in labelling grid.
            CustomizedLabellingSettings.IslabelingNameExist(input.ExpectedData.CommonNames[0]);
        }
Exemple #14
0
        public void ModifyCustomizedLabelingCancelled(CustomizedLabellingSettingData input)
        {
            //Click a labeling  from list and click 修改 button.
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[0]);
            TimeManager.LongPause();

            //Click Cancel button directly.
            CustomizedLabellingSettings.ClickCancelButton();
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            //check the labeling's data
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, CustomizedLabellingSettings.GetCommodityComboBoxValue());
            Assert.AreEqual(input.ExpectedData.KPIType, CustomizedLabellingSettings.GetKPITypeComboBoxValue());
            Assert.AreEqual(input.ExpectedData.LabellingLevel, CustomizedLabellingSettings.GetLabellingLevelComboBoxValue());

            //check labelingGrade Firstlabel&Lastlabel.
            Assert.AreEqual(input.ExpectedData.Firstlabels[0], CustomizedLabellingSettings.GetLabellingGradeFirstLabel());
            Assert.AreEqual(input.ExpectedData.Lastlabels[0], CustomizedLabellingSettings.GetLabellingGradeLastLabel());

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //check labelingGrade count
            int count = Convert.ToInt32(input.InputData.LabellingLevelValues[0]);

            Assert.AreEqual(count, CustomizedLabellingSettings.GetLabellingGradeCount());

            //这里有个问题,对于中文版,有些单位还是习惯性的用缩写英文表示,没有显示成中文,这个后续会和UI确认
            //Check UOM
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]); num++)
            {
                Assert.AreEqual(input.ExpectedData.UOM, CustomizedLabellingSettings.GetLabellingUOMValue(num + 1));
            }

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //Check lalelling level's right value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }

            //Click labeling "自定义能效标识9" from list and click 修改 button.
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[0]);
            CustomizedLabellingSettings.ClickModifyButton();

            // Change all fields as TestData.
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonNames[1]);
            CustomizedLabellingSettings.SelectCommodityComboBox(input.InputData.Commodities[1]);
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevels[1]);
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPITypes[1]);

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[1]); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[1][num].LabellingLeftValue);
            }

            //Click Cancel button directly.
            CustomizedLabellingSettings.ClickCancelButton();
            JazzMessageBox.LoadingMask.WaitLoading();
            TimeManager.MediumPause();

            //Go to select "Modify to 自定义能效标识9"
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[0]);
            CustomizedLabellingSettings.ClickModifyButton();

            //he labeling display view status before modify.
            //check the labeling's data
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, CustomizedLabellingSettings.GetCommodityComboBoxValue());
            Assert.AreEqual(input.ExpectedData.KPIType, CustomizedLabellingSettings.GetKPITypeComboBoxValue());
            Assert.AreEqual(input.ExpectedData.LabellingLevel, CustomizedLabellingSettings.GetLabellingLevelComboBoxValue());

            //Check AscendingCustomizedLabellingButton is "倒序"
            Assert.AreEqual(input.ExpectedData.Order[1], CustomizedLabellingSettings.GetDescendingCustomizedLabellingButton());

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //Check lalelling level's right value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }
        }
        public void ModifyCustomizedLabelingValid01(CustomizedLabellingSettingData input)
        {
            //Click an exist labelling.
            TimeManager.LongPause();
            TimeManager.LongPause();
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[0], input.ExpectedData.ConfigurationUser);
            TimeManager.LongPause();

            //check the labeling's data
            Assert.AreEqual(input.InputData.CommonNames[0], CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.InputData.Commodities[0], CustomizedLabellingSettings.GetCommodityComboBoxValue());
            Assert.AreEqual(input.InputData.KPITypes[0], CustomizedLabellingSettings.GetKPITypeComboBoxValue());
            Assert.AreEqual(input.InputData.LabellingLevels[0], CustomizedLabellingSettings.GetLabellingLevelComboBoxValue());

            //check labelingGrade Firstlabel&Lastlabel.
            Assert.AreEqual(input.ExpectedData.Firstlabels[0], CustomizedLabellingSettings.GetLabellingGradeFirstLabel());
            Assert.AreEqual(input.ExpectedData.Lastlabels[0], CustomizedLabellingSettings.GetLabellingGradeLastLabel());

            //Check AscendingCustomizedLabellingButton is "正序"
            Assert.AreEqual(input.ExpectedData.Order[0], CustomizedLabellingSettings.GetAscendingCustomizedLabellingButton());

            //check labelingGrade count
            int count = Convert.ToInt32(input.InputData.LabellingLevelValues[0]);

            Assert.AreEqual(count, CustomizedLabellingSettings.GetLabellingGradeCount());

            //这里有个问题,对于中文版,有些单位还是习惯性的用缩写英文表示,没有显示成中文,这个后续会和UI确认
            //Check UOM
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]); num++)
            {
                Assert.AreEqual(input.ExpectedData.UOM, CustomizedLabellingSettings.GetLabellingUOMValue(num + 1));
            }

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //Check lalelling level's right value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[0]) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[0][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }

            //Modify valid Labelling name.
            CustomizedLabellingSettings.ClickModifyButton();
            CustomizedLabellingSettings.FillInNameTextField(input.InputData.CommonNames[1]);

            //Change Commodity from dropdown list.
            CustomizedLabellingSettings.SelectCommodityComboBox(input.InputData.Commodities[1]);

            //Change 能耗标识级别=4 from dropdown list.
            CustomizedLabellingSettings.SelectLabellingLevelComboBox(input.InputData.LabellingLevels[1]);

            //Change to select KPI type=公休比.
            CustomizedLabellingSettings.SelectKPITypeComboBox(input.InputData.KPITypes[1]);

            //Check AscendingCustomizedLabellingButton is "倒序"
            Assert.AreEqual(input.ExpectedData.Order[1], CustomizedLabellingSettings.GetDescendingCustomizedLabellingButton());

            //Input Labelling Left Value
            for (int num = 1; num < Convert.ToInt32(input.InputData.LabellingLevelValues[1]); num++)
            {
                CustomizedLabellingSettings.FillInLabellingLevelLeftValue(num + 1, input.InputData.LabellingValue[1][num].LabellingLeftValue);
            }

            //Click Save button.
            CustomizedLabellingSettings.ClickSaveButton();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //Go to select "Modify to 自定义能效标识8"
            CustomizedLabellingSettings.FocusOnCustomizedLabelling(input.InputData.CommonNames[1]);
            CustomizedLabellingSettings.ClickModifyButton();

            //Change C right border from 0.5 to 3.
            CustomizedLabellingSettings.FillInLabellingLevelRightValue(3, input.InputData.LabellingValue[2][2].LabellingRightValue);

            //Click Save button.
            CustomizedLabellingSettings.ClickSaveButton();

            Assert.IsTrue(CustomizedLabellingSettings.IsInputValueErrTipsDisplayed());

            //Change B right border from 2 to 5.
            CustomizedLabellingSettings.FillInLabellingLevelRightValue(2, input.InputData.LabellingValue[3][1].LabellingRightValue);

            //Click Save button.
            CustomizedLabellingSettings.ClickSaveButton();
            TimeManager.LongPause();
            TimeManager.LongPause();

            //· Modify successfully and go to view status display Labelling the same as before save.
            Assert.IsTrue(CustomizedLabellingSettings.IslabelingNameExist(input.ExpectedData.CommonName));

            //check the labeling's data
            Assert.AreEqual(input.ExpectedData.CommonName, CustomizedLabellingSettings.GetNameTextFieldValue());
            Assert.AreEqual(input.ExpectedData.Commodity, CustomizedLabellingSettings.GetCommodityComboBoxValue());
            Assert.AreEqual(input.ExpectedData.KPIType, CustomizedLabellingSettings.GetKPITypeComboBoxValue());
            Assert.AreEqual(input.ExpectedData.LabellingLevel, CustomizedLabellingSettings.GetLabellingLevelComboBoxValue());

            //Check lalelling level's left value
            for (int num = 0; num < Convert.ToInt32(input.ExpectedData.LabellingLevelValue); num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[1][num].LabellingLeftValue, CustomizedLabellingSettings.GetLabellingGradeLeftValue(num + 1));
            }

            //Check lalelling level's right value
            for (int num = 1; num < Convert.ToInt32(input.ExpectedData.LabellingLevelValue) - 1; num++)
            {
                Assert.AreEqual(input.ExpectedData.LabellingValue[1][num].LabellingRightValue, CustomizedLabellingSettings.GetLabellingGradeRightValue(num + 1));
            }
        }