Skip to content

surface a method to empty the clipboard contents#2424

Merged
labkey-chrisj merged 3 commits intodevelopfrom
fb_chris_misc_tc_failures_fixes_4_22
Apr 23, 2025
Merged

surface a method to empty the clipboard contents#2424
labkey-chrisj merged 3 commits intodevelopfrom
fb_chris_misc_tc_failures_fixes_4_22

Conversation

@labkey-chrisj
Copy link
Copy Markdown
Contributor

Rationale

This change adds a public method to allow tests to clear the clipboard without resorting to copying empty grid cells

Related Pull Requests

https://github.com/LabKey/limsModules/pull/1355

Changes

  • pull the implementation of setting the clipboard out into its own protected method
  • surface a public method to allow clearing the clipboard

Copy link
Copy Markdown
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

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

Does this actually work? This isn't really how clipboards work; copying with no selection doesn't generally clear the clipboard (maybe OS dependent?). You might need to set it to a single space (" ") to actually clear it. That's what my password manager does to avoid leaving password in the clipboard for too long.

@labkey-chrisj
Copy link
Copy Markdown
Contributor Author

Does this actually work? This isn't really how clipboards work; copying with no selection doesn't generally clear the clipboard (maybe OS dependent?). You might need to set it to a single space (" ") to actually clear it. That's what my password manager does to avoid leaving password in the clipboard for too long.

Does it work? Good question. At least on Windows, I can confirm that it does work. With some text in my clipboard, running that method means whatever was in my clipboard isn't any more.

For better context, PlateEditorTest.testCopyPasteColumnContent is the failure I'm trying to address.
If I understand the failure correctly, it's failing because selecting empty grid cells to copy that empty value results in throwing an UnsupportedFlavorException. The test here just wants to empty the clipboard before copying from the grid, so we know the copy worked.

Copy link
Copy Markdown
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

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

Does this work on Windows on TeamCity? If not, consider adding a workaround similar to the one in getClipboardContent

@labkey-chrisj
Copy link
Copy Markdown
Contributor Author

labkey-chrisj commented Apr 23, 2025

Does this work on Windows on TeamCity? If not, consider adding a workaround similar to the one in getClipboardContent

run queued to see: https://teamcity.labkey.org/buildConfiguration/LabKey_Trunk_Premium_ProductSuites_Biologics_BiologicsWindows?branch=chris_misc_tc_failures_fixes_4_22&buildTypeTab=overview

Result: PlateEditorTest.testCopyPasteColumnContent still fails, but because the copied content from the grid didn't include line breaks 🤔

I don't see the logging info from getClipboardContent about available/best flavors in the logs, but the value is non-null. Not sure what's happening here. Also kind of wondering if I should give up trying to copy from the grid on windows

@labkey-chrisj labkey-chrisj merged commit 8ca6962 into develop Apr 23, 2025
3 checks passed
@labkey-chrisj labkey-chrisj deleted the fb_chris_misc_tc_failures_fixes_4_22 branch April 23, 2025 22:06
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