Skip to content

Commit ef4741c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into fb_htmlwriter
2 parents b07386d + 45f1975 commit ef4741c

41 files changed

Lines changed: 2412 additions & 1033 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
apacheCommonsCsvVersion=1.14.0
22

3-
aspectjVersion=1.9.23
3+
aspectjVersion=1.9.24
44

55
assertjVersion=3.27.3
66

77
awaitilityVersion=4.3.0
88

99
lookfirstSardineVersion=5.13
1010

11-
jettyVersion=12.0.18
11+
jettyVersion=12.0.21
1212

13-
seleniumVersion=4.27.0
13+
seleniumVersion=4.33.0
1414

1515
mockserverNettyVersion=5.15.0
1616

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Name: simpletest
2-
SchemaVersion: 25.000
2+
SchemaVersion: 25.001
33
SupportedDatabases: mssql, pgsql
44
ManageVersion: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE UNIQUE INDEX AK_Name ON vehicle.Manufacturers (Name);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE UNIQUE INDEX AK_Name ON vehicle.Manufacturers (Name);

src/org/labkey/test/BaseWebDriverTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import org.junit.runners.model.MultipleFailureException;
4141
import org.junit.runners.model.Statement;
4242
import org.junit.runners.model.TestTimedOutException;
43-
import org.labkey.api.query.QueryKey;
43+
import org.labkey.api.query.FieldKey;
4444
import org.labkey.junit.rules.TestWatcher;
4545
import org.labkey.remoteapi.CommandException;
4646
import org.labkey.remoteapi.CommandResponse;
@@ -218,7 +218,7 @@ public abstract class BaseWebDriverTest extends LabKeySiteWrapper implements Cle
218218

219219
public static final double DELTA = 10E-10;
220220

221-
public static final String[] ILLEGAL_QUERY_KEY_CHARACTERS = QueryKey.ILLEGAL;
221+
public static final String[] ILLEGAL_QUERY_KEY_CHARACTERS = FieldKey.ILLEGAL;
222222
public static final String ALL_ILLEGAL_QUERY_KEY_CHARACTERS = StringUtils.join(ILLEGAL_QUERY_KEY_CHARACTERS, "");
223223
// See TSVWriter.shouldQuote. Generally we are not able to use the tab and new line characters when creating field names in the UI, but including here for completeness
224224
public static final String[] TRICKY_IMPORT_FIELD_CHARACTERS = {"\\", "\"", "\\t", ",", "\\n", "\\r"};

src/org/labkey/test/TestFileUtils.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@
4848
import java.io.BufferedInputStream;
4949
import java.io.BufferedOutputStream;
5050
import java.io.BufferedReader;
51+
import java.io.BufferedWriter;
5152
import java.io.ByteArrayInputStream;
5253
import java.io.File;
5354
import java.io.FileInputStream;
5455
import java.io.FileOutputStream;
5556
import java.io.IOException;
5657
import java.io.InputStream;
5758
import java.io.OutputStream;
59+
import java.io.OutputStreamWriter;
5860
import java.io.Writer;
5961
import java.nio.charset.Charset;
6062
import java.nio.charset.StandardCharsets;
@@ -470,7 +472,12 @@ public static File writeTempFile(String name, String contents) throws IOExceptio
470472
*/
471473
public static File writeFile(File file, String contents) throws IOException
472474
{
473-
try (Writer writer = PrintWriters.getPrintWriter(file))
475+
return writeFile(file, contents, false);
476+
}
477+
478+
public static File writeFile(File file, String contents, boolean append) throws IOException
479+
{
480+
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file, append), StandardCharsets.UTF_8))
474481
{
475482
writer.write(contents);
476483
return file;
@@ -578,10 +585,10 @@ private static List<File> unTar(final File inputFile, final File outputDir) thro
578585
{
579586
final List<File> untaredFiles = new ArrayList<>();
580587
try (InputStream is = new FileInputStream(inputFile);
581-
TarArchiveInputStream inputStream = (TarArchiveInputStream) new ArchiveStreamFactory().createArchiveInputStream("tar", is))
588+
TarArchiveInputStream inputStream = new ArchiveStreamFactory().createArchiveInputStream("tar", is))
582589
{
583590
TarArchiveEntry entry;
584-
while ((entry = (TarArchiveEntry) inputStream.getNextEntry()) != null)
591+
while ((entry = inputStream.getNextEntry()) != null)
585592
{
586593
final File outputFile = new File(outputDir, entry.getName());
587594
if (entry.isDirectory())
@@ -598,7 +605,7 @@ private static List<File> unTar(final File inputFile, final File outputDir) thro
598605
{
599606
try (OutputStream outputFileStream = new FileOutputStream(outputFile))
600607
{
601-
org.apache.commons.compress.utils.IOUtils.copy(inputStream, outputFileStream);
608+
IOUtils.copy(inputStream, outputFileStream);
602609
}
603610
}
604611
untaredFiles.add(outputFile);

src/org/labkey/test/WebDriverWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3434,7 +3434,7 @@ public void setFormElement(Locator l, String text)
34343434
*/
34353435
public void setFormElement(WebElement el, String text)
34363436
{
3437-
String inputType = el.getAttribute("type");
3437+
String inputType = el.getDomAttribute("type");
34383438

34393439
if ("file".equals(inputType))
34403440
{

src/org/labkey/test/components/ManageSampleStatusesPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public boolean isLocked()
158158
public List<String> getStatusNames()
159159
{
160160
return elementCache().statusItems
161-
.findElements(this)
161+
.waitForElements(this, 2_000)
162162
.stream()
163163
.map(WebElement::getText)
164164
.collect(Collectors.toList());

src/org/labkey/test/components/react/Tabs.java

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,34 @@ public WebDriver getDriver()
5353
return _driver;
5454
}
5555

56+
public WebElement findTab(String tabText)
57+
{
58+
return elementCache().findTab(tabText);
59+
}
60+
5661
public WebElement findPanelForTab(String tabText)
5762
{
58-
return elementCache().findTabPanel(tabText);
63+
return elementCache().findTabPanel(elementCache().findTab(tabText));
5964
}
6065

6166
public WebElement selectTab(String tabText)
6267
{
6368
WebElement tab = elementCache().findTab(tabText);
6469
getWrapper().scrollIntoView(tab);
6570
tab.click();
66-
WebElement panel = findPanelForTab(tabText);
71+
WebElement panel = elementCache().findTabPanel(tab);
6772
getWrapper().shortWait().until(ExpectedConditions.visibilityOf(panel));
6873
return panel;
6974
}
7075

76+
public WebElement findPanelForActiveTab()
77+
{
78+
return elementCache().findTabPanel(elementCache().findSelectedTab());
79+
}
80+
7181
public boolean isTabSelected(String tabText)
7282
{
73-
return Boolean.valueOf(elementCache().findTab(tabText).getAttribute("aria-selected"));
83+
return Boolean.valueOf(elementCache().findTab(tabText).getDomAttribute("aria-selected"));
7484
}
7585

7686
public List<String> getTabText()
@@ -80,6 +90,16 @@ public List<String> getTabText()
8090
.stream().map(WebElement::getText).toList();
8191
}
8292

93+
public String getSelectedTabText()
94+
{
95+
return elementCache().findSelectedTab().getText();
96+
}
97+
98+
public String getSelectedTabKey()
99+
{
100+
return elementCache().findSelectedTab().getDomAttribute("data-event-key");
101+
}
102+
83103
@Override
84104
protected ElementCache newElementCache()
85105
{
@@ -102,6 +122,11 @@ public ElementCache()
102122
}
103123
}
104124

125+
protected WebElement findSelectedTab()
126+
{
127+
return tabLoc.withAttribute("aria-selected", "true").findElement(this);
128+
}
129+
105130
List<WebElement> findAllTabs()
106131
{
107132
if (tabs.isEmpty())
@@ -125,25 +150,25 @@ WebElement findTab(String tabText)
125150
catch (NoSuchElementException ex)
126151
{
127152
throw new NoSuchElementException(String.format("'%s' not among available tabs: %s",
128-
tabText, getWrapper().getTexts(findAllTabs())), ex);
153+
tabText, getWrapper().getTexts(findAllTabs())), ex);
129154
}
130155
tabMap.put(tabText, tabEl);
131156
}
132157
return tabMap.get(tabText);
133158
}
134159

135160
// Tab panels can be updated and changed when flipping between tabs. Don't persist the panel element find it each time.
136-
WebElement findTabPanel(String tabText)
161+
WebElement findTabPanel(WebElement tabElement)
137162
{
138-
String panelId = findTab(tabText).getAttribute("aria-controls");
163+
String panelId = tabElement.getDomAttribute("aria-controls");
139164
WebElement panelEl;
140165
try
141166
{
142167
panelEl = Locator.id(panelId).findElement(tabContent);
143168
}
144169
catch (NoSuchElementException ex)
145170
{
146-
throw new NoSuchElementException("Panel not found for tab : " + tabText, ex);
171+
throw new NoSuchElementException("Panel not found for tab : " + tabElement.getText(), ex);
147172
}
148173

149174
return panelEl;

0 commit comments

Comments
 (0)