Skip to content

Conversation

@XingY
Copy link
Contributor

@XingY XingY commented Aug 1, 2025

Rationale

Selenium test for Issue 53498: Sample Manager: Attachment field is lost after export/import round trip. We are no longer accepting string values for attachment fields for import. The exception is list archive import, which we do still allow attachment name being provided.

Related Pull Requests

Changes

  • add test for importing attachment as string from tsv file - should fail
  • add test for importing list archive with attachment - should be successful

try
{
String expectedError = "Row 1: Can't upload '" + attachmentValue + "' to field " + LIST_ATTACHMENT01_NAME + " with type Attachment.";
isElementPresent(Locator.tagWithClass("div", "labkey-error").withText(expectedError));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be an assertion attached to this? The catch will fail if there is no error, but will succeed if the error is something else, which may hide the failure for the attachment field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. fixed.

}
catch(NoSuchElementException nse)
{
checker().fatal().error("Invalid attachment error not present.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fatal? Seems like testing of the other import scenarios could still proceed (though will likely also fail).

public class InlineImagesListTest extends BaseWebDriverTest
{
private final static String PROJECT_NAME = "InlineImagesListTestProject";
private final static String IMPORT_PROJECT_NAME = "InlineImagesListImportTestProject";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For good measure, might want to change these to have spaces between words as that is more realistic.

@XingY XingY requested a review from labkey-susanh August 1, 2025 21:41
}
catch(NoSuchElementException nse)
{
checker().error("Invalid attachment error not present.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
checker().error("Invalid attachment error not present.");
checker().withScreenshot().error("Invalid attachment error not present.");

@XingY XingY merged commit c29e288 into release25.7-SNAPSHOT Aug 4, 2025
8 checks passed
@XingY XingY deleted the 25.7_fb_issue53498 branch August 4, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants