@@ -1047,8 +1047,6 @@ private void checkForCorrectAnnotations(String plotType, QCPlotsWebPart qcPlotsW
10471047 {
10481048 List <QCPlot > qcPlots = qcPlotsWebPart .getPlots ();
10491049 Bag <QCHelper .Annotation > expectedAnnotations = new HashBag <>();
1050- // instrumentChange is added twice, once using traditional insert and then via qc plots
1051- expectedAnnotations .add (instrumentChange );
10521050 expectedAnnotations .add (instrumentChange );
10531051 expectedAnnotations .add (reagentChange );
10541052 expectedAnnotations .add (technicianChange );
@@ -1113,6 +1111,36 @@ private void verifyAddAnnotationsFromQCPlots()
11131111 break ;
11141112 }
11151113 assertTrue ("Newly added annotation should appear in QC plots" , annotationFound );
1114+
1115+ Locator deleteAnnotation = Locator .tagWithClass ("path" , "annotation" );
1116+ mouseOver (deleteAnnotation );
1117+ click (deleteAnnotation );
1118+ waitForElement (Locator .xpath ("//div[contains(@class, 'x4-window')]//span[text()='Edit Annotation']" ));
1119+ clickButton ("Delete" , 0 );
1120+ waitForText ("Are you sure you want to delete this annotation?" );
1121+ clickButton ("Yes" , 0 );
1122+ waitForText ("Annotation deleted successfully" );
1123+ clickButton ("OK" , 0 );
1124+ _ext4Helper .waitForMaskToDisappear ();
1125+
1126+ refresh ();
1127+ qcPlotsWebPart = qcDashboard .getQcPlotsWebPart ();
1128+ annotationFound = false ;
1129+ qcPlots = qcPlotsWebPart .getPlots ();
1130+ for (QCPlot plot : qcPlots )
1131+ {
1132+ List <QCHelper .Annotation > annotations = plot .getAnnotations ();
1133+ for (QCHelper .Annotation annotation : annotations )
1134+ {
1135+ if (annotation .getType ().equals (testAnnotation .getType ()) &&
1136+ annotation .getDescription ().equals (testAnnotation .getDescription ()))
1137+ {
1138+ annotationFound = true ;
1139+ break ;
1140+ }
1141+ }
1142+ }
1143+ assertFalse ("Newly deleted annotation should not appear in QC plots" , annotationFound );
11161144 }
11171145
11181146}
0 commit comments