@@ -472,30 +472,14 @@ public void testAllowedFileExtensionsInSampleType()
472472 // Not sure why we record two exceptions.
473473 checkExpectedErrors (2 );
474474
475- // Issue 53026 (or at least part of it)
476- log ("Click 'Back' button and validate that the fields still have all the expected values." );
477- waitForElement (Locator .button ("Back" ));
478- clickButton ("Back" );
479-
480- waitForElement (Locator .name ("quf_" + stFileField ));
481-
482- checker ().verifyEquals ("'Name' field does not have expected value." ,
483- sampleId , getFormElement (Locator .name ("quf_Name" )));
484-
485- checker ().verifyEquals ("'Description' field does not have expected value." ,
486- description , getFormElement (Locator .name ("quf_Description" )));
487-
488- checker ().verifyEquals ("'StoredAmount' field does not have expected value." ,
489- amount , getFormElement (Locator .name ("quf_StoredAmount" )));
490-
491- checker ().screenShotIfNewError ("Field_Values_Error" );
492-
493475 // Issue 53027
494- log ("Clear the file field and resubmit." );
495- FileInput el = FileInput .FileInput (Locator .name ("quf_" + stFileField ), getDriver ()).findWhenNeeded ();
496- executeScript ("arguments[0].value = '';" , el .getComponentElement ());
497-
498- clickButton ("Submit" );
476+ goToProjectHome ();
477+ sampleTypeHelper = new SampleTypeHelper (this );
478+ sampleTypeHelper .goToSampleType (stName );
479+ fieldMap = Map .of ("Name" , sampleId ,
480+ "Description" , description ,
481+ "StoredAmount" , amount );
482+ sampleTypeHelper .insertRow (fieldMap );
499483
500484 Map <String , String > rowMap = sampleTypeHelper .getSamplesDataRegionTable ().getRowDataAsMap (0 );
501485
@@ -581,57 +565,6 @@ public void testAllowedFilesInMessages()
581565 // Not sure why we record two exceptions.
582566 checkExpectedErrors (2 );
583567
584- // Issue 53026 Fields cleared after clicking 'Back' button.
585- log ("Click 'Back' button and validate that the fields still have all the expected values." );
586- waitForElement (Locator .button ("Back" ));
587- clickButton ("Back" );
588-
589- waitForElement (Locator .tagWithId ("textarea" , "body" ));
590-
591- page = new InsertPage (getDriver ());
592-
593- checker ().verifyEquals ("Message title was not persisted." ,
594- notAllowedTitle , page .getTitle ());
595-
596- checker ().verifyEquals ("Message body was not persisted." ,
597- notAllowedBody , page .getBody ());
598-
599- List <WebElement > attachmentElements = Locator .tagWithAttributeContaining ("span" , "id" ,"filename" )
600- .findElements (getDriver ());
601-
602- checker ().verifyEqualsSorted ("None of the previous attachments are still present." ,
603- notAllowedAttachments , attachmentElements
604- .stream ().map (WebElement ::getText ).toList ());
605-
606- checker ().screenShotIfNewError ("Field_Values_After_Disallowed_Error" );
607-
608- log ("Remove the offending file and resubmit the message." );
609-
610- // This did not work for me. The index is correct but fails saying could not find link with text "remove".
611- // page.removeAttachment(attachmentElements
612- // .stream().map(WebElement::getText).toList()
613- // .indexOf(fileMap.get(excludedType).getName()));
614-
615- List <WebElement > removeLinks = Locator .linkContainingText ("remove" ).findElements (getDriver ());
616-
617- WebElement removeLink = removeLinks .get (attachmentElements
618- .stream ().map (WebElement ::getText ).toList ()
619- .indexOf (fileMap .get (excludedType ).getName ()));
620-
621- removeLink .click ();
622-
623- shortWait ().until (ExpectedConditions .stalenessOf (removeLink ));
624-
625- page .submit ();
626-
627- goToProjectHome ();
628-
629- DataRegionTable dataRegion = DataRegion (getDriver ()).withName ("Announcements" ).find ();
630-
631- checker ().withScreenshot ()
632- .verifyEqualsSorted ("Not all messages are there." ,
633- List .of (allowedTitle , notAllowedTitle ), dataRegion .getColumnDataAsText ("Title" ));
634-
635568 }
636569
637570 private AllowedFileExtensionAdminPage setAllowedExtensions (List <String > allowedTypes , List <String > expectedTypes )
0 commit comments