diff --git a/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js b/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js index 14807644f..e0df70a6c 100644 --- a/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js +++ b/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js @@ -72,8 +72,9 @@ Ext4.define('LabPurchasing.panel.VendorPanel', { this.mun(this.store, onError); btn.setDisabled(false); - var store = Ext4.StoreManager.get('labpurchasing||vendors||rowId||vendorName'); + var store = Ext4.StoreManager.get('labpurchasing||vendors||rowId||vendorName||'); if (store) { + store.removeAll(); store.load(); } diff --git a/LabPurchasing/test/src/org/labkey/test/tests/labpurchasing/LabPurchasingTest.java b/LabPurchasing/test/src/org/labkey/test/tests/labpurchasing/LabPurchasingTest.java index 0bb8ef0cb..8375d4646 100644 --- a/LabPurchasing/test/src/org/labkey/test/tests/labpurchasing/LabPurchasingTest.java +++ b/LabPurchasing/test/src/org/labkey/test/tests/labpurchasing/LabPurchasingTest.java @@ -91,10 +91,11 @@ public void testLabPurchasingModule() waitAndClick(Ext4Helper.Locators.ext4Button("Add Vendor")); new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); click(Ext4Helper.Locators.ext4Button("OK")); + sleep(500); // allow the client store to reset // Adding the new vendor should have updated the combo: grid.clickTbarButton("Add New"); - checker().withScreenshot("LabPurchasingBeforeVendor"); + getArtifactCollector().dumpPageSnapshot("LabPurchasingBeforeVendor"); grid.setGridCell(1, "vendorId", "New Vendor 1"); try { @@ -102,15 +103,23 @@ public void testLabPurchasingModule() } catch (AssertionError e) { - checker().withScreenshot("LabPurchasingVendor0"); + getArtifactCollector().dumpPageSnapshot("LabPurchasingVendor0"); WebElement el = grid.startEditing(1, "vendorId"); - checker().withScreenshot("LabPurchasingVendor1"); + getArtifactCollector().dumpPageSnapshot("LabPurchasingVendor1"); + + boolean storeExists = executeScript("return Ext4.StoreManager.get('labpurchasing||vendors||rowId||vendorName') != null", Boolean.class); + log("Store exists: " + storeExists); + if (storeExists) + { + long recordCount = executeScript("return Ext4.StoreManager.get('labpurchasing||vendors||rowId||vendorName').getCount()", Long.class); + log("Record count: " + recordCount); + } setFormElementJS(el, ""); el.sendKeys("New Vendor 1"); sleep(1000); - checker().withScreenshot("LabPurchasingVendor2"); + getArtifactCollector().dumpPageSnapshot("LabPurchasingVendor2"); throw e; } @@ -213,4 +222,4 @@ public List getAssociatedModules() { return Collections.singletonList("LabPurchasing"); } -} \ No newline at end of file +}