Skip to content

Commit 5595f61

Browse files
committed
Merge remote-tracking branch 'origin/develop' into fb_drop_indices
2 parents b5c5676 + 9cb7d02 commit 5595f61

7 files changed

Lines changed: 107 additions & 94 deletions

File tree

ehr/api-src/org/labkey/api/ehr/SharedEHRUpgradeCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ private void importFile(TsvImport tsvImport, Container container, User user) thr
317317
updateService.truncateRows(user, container, null, null);
318318

319319
BatchValidationException errors = new BatchValidationException();
320-
AuditBehaviorType behaviorType = table.getAuditBehavior();
320+
AuditBehaviorType behaviorType = table.getEffectiveAuditBehavior();
321321
TransactionAuditProvider.TransactionAuditEvent auditEvent = null;
322322
if (behaviorType != null && behaviorType != AuditBehaviorType.NONE)
323323
auditEvent = createTransactionAuditEvent(container, QueryService.AuditAction.INSERT);

ehr/src/org/labkey/ehr/EHRController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ private void loadFile(UserSchema schema, String tableName, Resource resource, bo
14991499
DataLoader loader = DataLoader.get().createLoader(resource, true, null, TabLoader.TSV_FILE_TYPE);
15001500

15011501
BatchValidationException batchErrors = new BatchValidationException();
1502-
AuditBehaviorType behaviorType = table.getAuditBehavior();
1502+
AuditBehaviorType behaviorType = table.getEffectiveAuditBehavior();
15031503
TransactionAuditProvider.TransactionAuditEvent auditEvent = null;
15041504
if (behaviorType != null && behaviorType != AuditBehaviorType.NONE)
15051505
auditEvent = createTransactionAuditEvent(getContainer(), QueryService.AuditAction.INSERT);
@@ -1668,7 +1668,7 @@ public Object execute(PopulateLookupsForm form, BindException errors) throws Exc
16681668
DataLoader loader = DataLoader.get().createLoader(_reportsResource, true, null, TabLoader.TSV_FILE_TYPE);
16691669

16701670
BatchValidationException batchErrors = new BatchValidationException();
1671-
AuditBehaviorType behaviorType = table.getAuditBehavior();
1671+
AuditBehaviorType behaviorType = table.getEffectiveAuditBehavior();
16721672
TransactionAuditProvider.TransactionAuditEvent auditEvent = null;
16731673
if (behaviorType != null && behaviorType != AuditBehaviorType.NONE)
16741674
auditEvent = createTransactionAuditEvent(getContainer(), QueryService.AuditAction.INSERT);

ehr/src/org/labkey/ehr/pipeline/GeneticCalculationsImportTask.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,7 @@ private static void processInbreeding(Container c, User u, File pipelineDir, Log
689689
continue;
690690
}
691691

692-
//row.put("Id", subjectId);
693-
row.put("participantid", subjectId);
692+
row.put("Id", subjectId);
694693
row.put("date", date);
695694
row.put("coefficient", Double.parseDouble(fields[1]));
696695

snd/test/src/org/labkey/test/components/snd/CategoryEditRow.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public WebDriver getDriver()
5757
public CategoryEditRow setDescription(String value)
5858
{
5959
elementCache().descriptionInput.set(value);
60-
getWrapper().waitFor(()-> elementCache().descriptionInput.get() == value, 2000);
60+
WebDriverWrapper.waitFor(()-> value.equals(elementCache().descriptionInput.get()), 2000);
6161
return this;
6262
}
6363

@@ -80,7 +80,7 @@ public boolean getIsActive()
8080
public void delete()
8181
{
8282
getWrapper().fireEvent(elementCache().deleteLI, WebDriverWrapper.SeleniumEvent.mouseover);
83-
getWrapper().waitFor(()-> elementCache().deleteLI.isEnabled() && elementCache().deleteLI.isSelected(), 2000);
83+
WebDriverWrapper.waitFor(()-> elementCache().deleteLI.isEnabled() && elementCache().deleteLI.isSelected(), 2000);
8484
elementCache().deleteLI.click();
8585
}
8686

@@ -90,7 +90,7 @@ protected ElementCache newElementCache()
9090
return new ElementCache();
9191
}
9292

93-
protected class ElementCache extends Component.ElementCache
93+
protected class ElementCache extends Component<?>.ElementCache
9494
{
9595
Input descriptionInput = Input(Locators.descriptionEdit(), getDriver()).timeout(4000).findWhenNeeded(this);
9696
Checkbox activeCheckBox = Checkbox.Checkbox(

snd/test/src/org/labkey/test/components/snd/SuperPackageRow.java

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,38 +61,41 @@ public boolean isSelected()
6161
public SuperPackageRow select() // note: this 'selection' behavior is expressed among assigned packages, not among available packages
6262
{
6363
if (!isSelected())
64-
newElementCache().desc.click();
65-
getWrapper().waitFor(()-> isSelected(),
64+
elementCache().desc.click();
65+
WebDriverWrapper.waitFor(this::isSelected,
6666
"row item never became selected",2000);
6767
return this;
6868
}
6969

7070
public String getLabel()
7171
{
72-
return newElementCache().desc.getText();
72+
return elementCache().desc.getText();
7373
}
7474

7575
public SuperPackageRow clickMenuItem(String menuText)
7676
{
77-
getWrapper().fireEvent(newElementCache().menuToggle, WebDriverWrapper.SeleniumEvent.mouseover);
78-
newElementCache().menuToggle.click();
79-
// wait for the menu to expand
80-
getWrapper().waitFor(()-> newElementCache().menuToggle.getAttribute("class").contains("open"), 1000);
81-
Locator menuItem = Locator.tagWithAttribute("li", "role", "presentation")
82-
.child(Locator.tagWithAttribute("a", "role", "menuitem")
83-
.containing(menuText));
84-
WebElement itemToClick = menuItem.waitForElement(getComponentElement(), 2000);
85-
getWrapper().fireEvent(newElementCache().menuToggle, WebDriverWrapper.SeleniumEvent.mouseover);
86-
getWrapper().waitFor(()-> itemToClick.isEnabled(), 2000);
87-
itemToClick.click();
88-
// wait for the menu to collapse (or disappear, if 'remove' was the action')
89-
getWrapper().waitFor(()-> {
90-
try
91-
{
92-
return newElementCache().menuToggle.getAttribute("aria-expanded").equals("false");
93-
}catch (StaleElementReferenceException sere){return true;}
94-
}, 1000);
95-
return this;
77+
getWrapper().mouseOver(this.getComponentElement());
78+
elementCache().menuToggle.click();
79+
// wait for the menu to expand
80+
WebDriverWrapper.waitFor(() -> elementCache().menuToggle.getAttribute("aria-expanded").equals("true"), () -> "Menu didn't open: " + getLabel(), 1000);
81+
Locator menuItem = Locator.tagWithAttribute("li", "role", "presentation")
82+
.child(Locator.tagWithAttribute("a", "role", "menuitem")
83+
.containing(menuText));
84+
WebElement itemToClick = menuItem.waitForElement(getComponentElement(), 2000);
85+
WebDriverWrapper.waitFor(itemToClick::isEnabled, () -> "Menu item not enabled: " + menuText, 2000);
86+
itemToClick.click();
87+
// wait for the menu to collapse (or disappear, if 'remove' was the action')
88+
WebDriverWrapper.waitFor(() -> {
89+
try
90+
{
91+
return elementCache().menuToggle.getAttribute("aria-expanded").equals("false");
92+
}
93+
catch (StaleElementReferenceException sere)
94+
{
95+
return true;
96+
}
97+
}, "Menu didn't close", 1000);
98+
return this;
9699
}
97100

98101
@Override
@@ -101,7 +104,7 @@ protected ElementCache newElementCache()
101104
return new ElementCache();
102105
}
103106

104-
protected class ElementCache extends Component.ElementCache
107+
protected class ElementCache extends Component<?>.ElementCache
105108
{
106109
public WebElement menuToggle = Locator.tagWithClassContaining("div", "btn-group") // sometimes dropdown, dropup
107110
.child(Locator.id("superpackage-actions"))

snd/test/src/org/labkey/test/pages/snd/EditCategoriesPage.java

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
import org.labkey.test.Locator;
1919
import org.labkey.test.WebDriverWrapper;
2020
import org.labkey.test.WebTestHelper;
21+
import org.labkey.test.components.bootstrap.ModalDialog;
2122
import org.labkey.test.components.snd.CategoryEditRow;
2223
import org.labkey.test.pages.LabKeyPage;
2324
import org.openqa.selenium.WebDriver;
2425
import org.openqa.selenium.WebElement;
26+
import org.openqa.selenium.support.ui.ExpectedConditions;
2527

2628
import java.util.List;
2729

@@ -73,18 +75,32 @@ public List<CategoryEditRow> getAllCategories()
7375

7476
public EditCategoriesPage clickSave()
7577
{
76-
waitFor(()-> elementCache().saveButton.getAttribute("disabled")==null,
77-
"'Save' button is disabled", 2000);
78-
elementCache().saveButton.click();
79-
sleep(1000); // todo: wait for save button to detatch/unmount before re-mounting into next page view
78+
return clickSave(false);
79+
}
80+
81+
public EditCategoriesPage clickSaveAndConfirmDelete()
82+
{
83+
return clickSave(true);
84+
}
85+
86+
public EditCategoriesPage clickSave(boolean confirmDelete)
87+
{
88+
shortWait().until(ExpectedConditions.elementToBeClickable(elementCache().saveButton)).click();
89+
if (confirmDelete)
90+
{
91+
new ModalDialog.ModalDialogFinder(getDriver())
92+
.withBodyTextContaining("Are you sure you want to delete row").find()
93+
.dismiss("Submit Changes");
94+
}
95+
shortWait().until(ExpectedConditions.stalenessOf(elementCache().saveButton));
96+
clearCache();
8097
return new EditCategoriesPage(getDriver());
8198
}
8299

83100
public PackageListPage clickCancel()
84101
{
85-
waitFor(()-> elementCache().cancelButton.getAttribute("disabled")==null,
86-
"'Cancel' button is disabled", 2000);
87-
elementCache().cancelButton.click();
102+
shortWait().until(ExpectedConditions.elementToBeClickable(elementCache().cancelButton)).click();
103+
shortWait().until(ExpectedConditions.stalenessOf(elementCache().cancelButton));
88104
return new PackageListPage(getDriver());
89105
}
90106

@@ -98,7 +114,7 @@ protected class ElementCache extends LabKeyPage.ElementCache
98114
{
99115
// TODO: Add other elements that are on the page
100116
WebElement addCategoriesBtn = Locator.tag("div").containing("Add Category")
101-
.withChild(Locator.tagWithClass("i", "fa fa-plus-circle"))
117+
.withChild(Locator.tagWithClass("i", "fa-plus-circle"))
102118
.findWhenNeeded(getDriver()).withTimeout(4000);
103119
WebElement cancelButton = Locator.button("Cancel").findWhenNeeded(getDriver()).withTimeout(4000);
104120
WebElement saveButton = Locator.button("Save").findWhenNeeded(getDriver()).withTimeout(4000);

0 commit comments

Comments
 (0)