From 9cf34d7047690e0fdba95578e13cb7fd5d7d9839 Mon Sep 17 00:00:00 2001 From: alanv Date: Fri, 20 Dec 2024 01:23:43 -0600 Subject: [PATCH] FileUploadPanel: Add backwards compat mode --- .../components/ui/files/FileUploadPanel.java | 21 ++++++++++++++++--- .../core/login/CompactFileUploadField.java | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/org/labkey/test/components/ui/files/FileUploadPanel.java b/src/org/labkey/test/components/ui/files/FileUploadPanel.java index d6cbe78a8b..4bfb0e3bea 100644 --- a/src/org/labkey/test/components/ui/files/FileUploadPanel.java +++ b/src/org/labkey/test/components/ui/files/FileUploadPanel.java @@ -18,11 +18,13 @@ public class FileUploadPanel extends WebDriverComponent { - private final Locator.XPathLocator _baseLocator = Locator.tagWithClass("div", "file-upload__container").parent(); + private Locator.XPathLocator _baseLocator = Locator.tagWithClass("div", "file-upload__container").parent(); + private final boolean _backwardsCompat; public FileUploadPanelFinder(WebDriver driver) { super(driver); + _backwardsCompat = false; + } + + public FileUploadPanelFinder(WebDriver driver, boolean backwardsCompat) + { + super(driver); + _backwardsCompat = backwardsCompat; + _baseLocator = Locator.tagWithClass("div", "file-upload--container").parent(); } + @Override protected FileUploadPanel construct(WebElement el, WebDriver driver) { - return new FileUploadPanel(el, driver); + return new FileUploadPanel(el, driver, _backwardsCompat); } @Override diff --git a/src/org/labkey/test/pages/core/login/CompactFileUploadField.java b/src/org/labkey/test/pages/core/login/CompactFileUploadField.java index 331b362089..f924ec488b 100644 --- a/src/org/labkey/test/pages/core/login/CompactFileUploadField.java +++ b/src/org/labkey/test/pages/core/login/CompactFileUploadField.java @@ -101,7 +101,7 @@ protected class ElementCache extends Component.ElementCache WebElement logoFileInput = Locator.tagWithClass("input", "file-upload__input") .refindWhenNeeded(this).withTimeout(4000); - WebElement removeBtn = Locator.tagWithClass("span", "file-upload__remove--icon") + WebElement removeBtn = Locator.tagWithClass("span", "attached-file__remove-icon") .refindWhenNeeded(this).withTimeout(4000); Locator attachedFile(File file)