From 732653c9e683631b2438371626bdbc677850006b Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 1 May 2023 06:02:58 -0700 Subject: [PATCH 1/4] Update LabPurchasingTest.java --- .../test/tests/labpurchasing/LabPurchasingTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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..8953b326f 100644 --- a/LabPurchasing/test/src/org/labkey/test/tests/labpurchasing/LabPurchasingTest.java +++ b/LabPurchasing/test/src/org/labkey/test/tests/labpurchasing/LabPurchasingTest.java @@ -94,7 +94,7 @@ public void testLabPurchasingModule() // 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 +102,15 @@ public void testLabPurchasingModule() } catch (AssertionError e) { - checker().withScreenshot("LabPurchasingVendor0"); + getArtifactCollector().dumpPageSnapshot("LabPurchasingVendor0"); WebElement el = grid.startEditing(1, "vendorId"); - checker().withScreenshot("LabPurchasingVendor1"); + getArtifactCollector().dumpPageSnapshot("LabPurchasingVendor1"); setFormElementJS(el, ""); el.sendKeys("New Vendor 1"); sleep(1000); - checker().withScreenshot("LabPurchasingVendor2"); + getArtifactCollector().dumpPageSnapshot("LabPurchasingVendor2"); throw e; } @@ -213,4 +213,4 @@ public List getAssociatedModules() { return Collections.singletonList("LabPurchasing"); } -} \ No newline at end of file +} From b326a775715c15a47782d458ee7dc903f124eed1 Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 1 May 2023 07:12:51 -0700 Subject: [PATCH 2/4] Debug LabPurchasingTest --- .../test/tests/labpurchasing/LabPurchasingTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 8953b326f..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,6 +91,7 @@ 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"); @@ -106,6 +107,14 @@ public void testLabPurchasingModule() WebElement el = grid.startEditing(1, "vendorId"); 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); From a55473fb5a07c137357f45af333fdc0ddd44a8ff Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 1 May 2023 07:13:31 -0700 Subject: [PATCH 3/4] Ensure client store cleared after add vendor --- LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js b/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js index 14807644f..162342779 100644 --- a/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js +++ b/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js @@ -74,6 +74,7 @@ Ext4.define('LabPurchasing.panel.VendorPanel', { var store = Ext4.StoreManager.get('labpurchasing||vendors||rowId||vendorName'); if (store) { + store.removeAll(); store.load(); } From 0a5164086532a5649a7ed35dd9d346c79b52b625 Mon Sep 17 00:00:00 2001 From: bbimber Date: Mon, 1 May 2023 09:01:20 -0700 Subject: [PATCH 4/4] Update storeId --- LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js b/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js index 162342779..e0df70a6c 100644 --- a/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js +++ b/LabPurchasing/resources/web/labpurchasing/panel/VendorPanel.js @@ -72,7 +72,7 @@ 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();