|
16 | 16 |
|
17 | 17 | package org.labkey.test.tests.mcc; |
18 | 18 |
|
| 19 | +import org.apache.commons.lang3.StringUtils; |
19 | 20 | import org.jetbrains.annotations.Nullable; |
20 | 21 | import org.junit.Assert; |
21 | 22 | import org.junit.Before; |
@@ -57,10 +58,10 @@ public class MccTest extends BaseWebDriverTest |
57 | 58 | @Test |
58 | 59 | public void testMccModule() throws Exception |
59 | 60 | { |
60 | | - doRequestFormTest(); |
61 | | - doRequestFormTestWithFailure(); |
| 61 | + //doRequestFormTest(); |
| 62 | + //doRequestFormTestWithFailure(); |
62 | 63 |
|
63 | | - testInvalidId(); |
| 64 | + //testInvalidId(); |
64 | 65 |
|
65 | 66 | testAnimalImportAndTransfer(); |
66 | 67 | } |
@@ -138,6 +139,47 @@ private void testAnimalImportAndTransfer() throws Exception |
138 | 139 | srr.getRows().forEach(row -> { |
139 | 140 | Assert.assertEquals("Incorrect QCState", "Completed", row.get("QCState/Label")); |
140 | 141 | }); |
| 142 | + |
| 143 | + // Now try a within-folder transfer: |
| 144 | + dr = DataRegionTable.DataRegion(getDriver()).withName("Dataset").waitFor(); |
| 145 | + dr.checkCheckbox(0); //Animal2 |
| 146 | + dr.clickHeaderMenu("More Actions", false, "Mark Animal Shipped"); |
| 147 | + |
| 148 | + new Window.WindowFinder(getDriver()).withTitle("Mark ID Shipped").waitFor(); |
| 149 | + Ext4FieldRef.getForLabel(this, "Effective Date").setValue(new SimpleDateFormat("MM/dd/yyyy").format(new Date())); |
| 150 | + combo = Ext4ComboRef.getForLabel(this, "Destination Center Name"); |
| 151 | + combo.clickTrigger(); |
| 152 | + waitAndClick(Locator.tagContainingText("li", "Other")); |
| 153 | + |
| 154 | + dialog = new Window.WindowFinder(getDriver()).withTitle("Enter Value").waitFor(); |
| 155 | + dialog.findElement(Locator.tag("input")).sendKeys("TargetColony2"); |
| 156 | + waitAndClick(Ext4Helper.Locators.ext4Button("OK")); |
| 157 | + sleep(100); |
| 158 | + |
| 159 | + Ext4ComboRef.getForLabel(this, "Target Folder").setComboByDisplayValue("Other"); |
| 160 | + waitAndClick(Ext4Helper.Locators.ext4Button("Submit")); |
| 161 | + |
| 162 | + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); |
| 163 | + waitAndClickAndWait(Ext4Helper.Locators.ext4Button("OK")); |
| 164 | + |
| 165 | + dr = DataRegionTable.DataRegion(getDriver()).withName("Dataset").waitFor(); |
| 166 | + Assert.assertEquals("Incorrect ID", "Animal2", dr.getDataAsText(0, "Id")); |
| 167 | + Assert.assertEquals("Incorrect Alias", mccId, dr.getDataAsText(0, "MCC Alias")); |
| 168 | + Assert.assertEquals("Incorrect Status", "<Alive>", dr.getDataAsText(0, "Status")); |
| 169 | + Assert.assertEquals("Incorrect Status", "Dam2", dr.getDataAsText(0, "Dam")); |
| 170 | + Assert.assertEquals("Incorrect Status", "Sire2", dr.getDataAsText(0, "Sire")); |
| 171 | + Assert.assertNull("Incorrect Value", StringUtils.trimToNull(dr.getDataAsText(0, "Exclude From Census?"))); |
| 172 | + Assert.assertEquals("Incorrect Colony", "TargetColony2", dr.getDataAsText(0, "colony")); |
| 173 | + Assert.assertEquals("Incorrect Colony", "TargetColony", dr.getDataAsText(0, "source")); |
| 174 | + |
| 175 | + sr = new SelectRowsCommand("study", "departure"); |
| 176 | + sr.setColumns(Arrays.asList("Id", "QCState/Label")); |
| 177 | + sr.setFilters(Arrays.asList(new Filter("Id", "Animal2"))); |
| 178 | + srr = sr.execute(createDefaultConnection(), getProjectName() + "/Colonies/Other"); |
| 179 | + Assert.assertEquals("Incorrect number of departures", 1, srr.getRowCount().intValue()); |
| 180 | + srr.getRows().forEach(row -> { |
| 181 | + Assert.assertEquals("Incorrect QCState", "Completed", row.get("QCState/Label")); |
| 182 | + }); |
141 | 183 | } |
142 | 184 |
|
143 | 185 | private static class FormElement |
|
0 commit comments