public static Boolean ValidateMessageOnPage(String message)
 {
     try
     {
         if (!Control_PropertyUtilities.compareMessage(DL_LabManagementPage.MessageOnLabManagementPage, message))
         {
             Console.WriteLine("Message is not correct. Message on page is:" + DL_LabManagementPage.MessageOnLabManagementPage.WebElement.Text);
             return(false);
         }
         if (DL_LabManagementPage.MessageOnLabManagementPage.WebElement.GetCssValue("color") != "rgba(255, 0, 0, 1)")
         {
             Console.WriteLine("Message color is:" + DL_LabManagementPage.MessageOnLabManagementPage.WebElement.GetCssValue("color"));
             return(false);
         }
         if (!Control_PropertyUtilities.CompareCSSValue(DL_LabManagementPage.MessageOnLabManagementPage, "text-align", "center"))
         {
             Console.WriteLine("Text is aligned in:" + DL_LabManagementPage.MessageOnLabManagementPage.WebElement.GetCssValue("text-align"));
             return(false);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(true);
 }
 public static bool TargetStudy()
 {
     try
     {
         IControl CodelistTable             = SyncUtilities.FindVisibleElement(By.Id("LabAttributeReference_0_CodeListMappingsReference_0_CodelistMapping_TT"));
         ReadOnlyCollection <IControl> rows = null;
         if (WebTableUtilities.GetRowCount(CodelistTable, out rows) > 0)
         {
             foreach (IControl row in rows)
             {
                 bool     found;
                 IControl celldata       = WebTableUtilities.GetCell(row, 1);
                 String   attribureValue = Control_PropertyUtilities.GetAttributeValue(celldata, "class", out found);
                 if (found)
                 {
                     if (attribureValue.Contains("modified-cell"))
                     {
                         Control_PropertyUtilities.CompareCSSValue(celldata, "background-color", "#fcdc75");
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(true);
 }
Beispiel #3
0
 public static bool VerifyColorOfButton()
 {
     try
     {
         return(Control_PropertyUtilities.CompareCSSValue(LabMappingsPage.AttributeMapping_CodelistMappingCancelButton, "Color", "rgb(102, 102, 102)"));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool SourceTargetStudy(List <StudyCompareReportData> sourcetargetData)
 {
     try
     {
         foreach (StudyCompareReportData sourcetargetitem in sourcetargetData)
         {
             IControl TargetCodelistTable        = SyncUtilities.FindVisibleElement(By.Id("LabAttributeReference_0_CodeListMappingsReference_0_CodelistMapping_TT"));
             IControl SourceCodelistTable        = SyncUtilities.FindVisibleElement(By.Id("LabAttributeReference_0_CodeListMappingsReference_0_CodelistMapping_ST"));
             ReadOnlyCollection <IControl> srows = null;
             ReadOnlyCollection <IControl> trows = null;
             if (WebTableUtilities.GetRowCount(SourceCodelistTable, out srows) > 0 && WebTableUtilities.GetRowCount(TargetCodelistTable, out trows) > 0)
             {
                 for (int rowIndex = 0; rowIndex < srows.Count; rowIndex++)
                 {
                     bool sfound = false;
                     //WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList();
                     //searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, sourcetargetitem.SourceStudy, TableColumnContentType.Text));
                     //IControl row = WebTableUtilities.Table_FindRow(SourceCodelistTable, searchList, 1);
                     IControl sourcecelldata       = WebTableUtilities.GetCell(srows[rowIndex], 1);
                     String   sourceattribureValue = Control_PropertyUtilities.GetAttributeValue(sourcecelldata, "class", out sfound);
                     if (sfound)
                     {
                         ReadOnlyCollection <IControl> targetTablerows = SyncUtilities.FindVisibleElements_Parent(TargetCodelistTable.WebElement, By.TagName("tr"));
                         if (sourceattribureValue.Equals("modified"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Contains("modified-cell"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(targetcelldata, "background-color", "#fcdc75");
                             }
                         }
                         else if (sourceattribureValue.Equals("deleted"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Equals("removedCell"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(sourcecelldata, "background-color", "#fcdc75");
                             }
                         }
                     }
                     else if (!sfound)
                     {
                         ReadOnlyCollection <IControl> targetTablerows = SyncUtilities.FindVisibleElements_Parent(TargetCodelistTable.WebElement, By.TagName("tr"));
                         if (sourceattribureValue.Contains("removedCell"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Contains("added"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(targetcelldata, "background-color", "#fcdc75");
                             }
                         }
                     }
                     else if (!sfound)
                     {
                         ReadOnlyCollection <IControl> targetTablerows = SyncUtilities.FindVisibleElements_Parent(TargetCodelistTable.WebElement, By.TagName("tr"));
                         if (sourceattribureValue.Contains("deleted"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Contains("removedCell"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(targetcelldata, "background-color", "#fcdc75");
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }