From 0b275cd8b6391d4d361faf93be32a3a33c32e89d Mon Sep 17 00:00:00 2001 From: bbimber Date: Wed, 5 Aug 2020 15:27:15 -0700 Subject: [PATCH 1/2] Name action and add option to manually start action --- .github/workflows/sync-repos.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sync-repos.yml b/.github/workflows/sync-repos.yml index e8486457..81818445 100644 --- a/.github/workflows/sync-repos.yml +++ b/.github/workflows/sync-repos.yml @@ -1,5 +1,8 @@ # Designed to keep develop branch as a perfect copy of LabKey fork +name: Sync Repos + on: + workflow_dispatch: schedule: - cron: "15 */3 * * *" jobs: From c480883706087ae4ea9d28662d85bf9d51233afe Mon Sep 17 00:00:00 2001 From: bbimber Date: Thu, 6 Aug 2020 20:02:13 -0700 Subject: [PATCH 2/2] Migrate many tests to Window.WindowFinder --- .../external/labModules/LabModulesTest.java | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/LDK/test/src/org/labkey/test/tests/external/labModules/LabModulesTest.java b/LDK/test/src/org/labkey/test/tests/external/labModules/LabModulesTest.java index 92827829..1ddd0e77 100644 --- a/LDK/test/src/org/labkey/test/tests/external/labModules/LabModulesTest.java +++ b/LDK/test/src/org/labkey/test/tests/external/labModules/LabModulesTest.java @@ -42,6 +42,7 @@ import org.labkey.test.components.CustomizeView; import org.labkey.test.components.ext4.ComboBox; import org.labkey.test.components.ext4.RadioButton; +import org.labkey.test.components.ext4.Window; import org.labkey.test.util.APIContainerHelper; import org.labkey.test.util.AdvancedSqlTest; import org.labkey.test.util.DataRegionTable; @@ -651,7 +652,7 @@ private void overviewUITest() assertElementPresent(Ext4Helper.Locators.menuItem("Upload/Import Data")); waitAndClick(Ext4Helper.Locators.menuItem("Plan Sequence Run (Create Readsets)")); - waitForElement(Ext4Helper.Locators.window("Plan Sequence Run (Create Readsets)")); + new Window.WindowFinder(getDriver()).withTitle("Plan Sequence Run (Create Readsets)").waitFor(); waitAndClick(Ext4Helper.Locators.ext4Button("Close")); } @@ -852,13 +853,13 @@ private void dataSourcesTest() throws Exception Ext4CmpRef addDataSourceBtn = _ext4Helper.queryOne("#" + manageDataSources + " button[text='Add Default Sources']", Ext4CmpRef.class); waitAndClick(Locator.id(addDataSourceBtn.getId())); waitAndClick(Ext4Helper.Locators.menuItem(DATA_SOURCE + " (\"/home\".core.Users)")); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); click(Ext4Helper.Locators.ext4Button("OK")); addDataSourceBtn = _ext4Helper.queryOne("#" + manageDataSources + " button[text='Add Default Sources']", Ext4CmpRef.class); waitAndClick(Locator.id(addDataSourceBtn.getId())); waitAndClick(Ext4Helper.Locators.menuItem(GROUP_SOURCE + " (core.Groups)")); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); click(Ext4Helper.Locators.ext4Button("OK")); waitForText("Item Type"); @@ -868,7 +869,7 @@ private void dataSourcesTest() throws Exception Ext4CmpRef addDemographicsSourceBtn = _ext4Helper.queryOne("#" + manageDemographicsSources + " button[text='Add Default Sources']", Ext4CmpRef.class); waitAndClick(Locator.id(addDemographicsSourceBtn.getId())); waitAndClick(Ext4Helper.Locators.menuItem(SUBJECT_LIST + " (laboratory.subjects)")); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); click(Ext4Helper.Locators.ext4Button("OK")); waitForText("Table Name"); @@ -990,7 +991,7 @@ private void deleteSourceByLabel(String label, String parentItemId) List removeBtns = _ext4Helper.componentQuery("#" + parentItemId + " button[text='Remove']", Ext4CmpRef.class); click(Locator.id(removeBtns.get(idx.intValue()).getId())); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); click(Ext4Helper.Locators.ext4Button("OK")); waitForText("Loading..."); @@ -1059,7 +1060,7 @@ private void settingsTest() Assert.assertFalse("Radio was not toggled", (Boolean) Ext4FieldRef.getForBoxLabel(this, "View All Major Events").getValue()); click(Ext4Helper.Locators.ext4Button("Submit")); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); click(Ext4Helper.Locators.ext4Button("OK")); //should redirect to lab home @@ -1123,7 +1124,7 @@ private void settingsTest() assertTrue("Incorrect value for samples checkbox", (Boolean)_ext4Helper.queryOne(samplesSelector, Ext4FieldRef.class).getValue()); click(Ext4Helper.Locators.ext4Button("Submit")); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); click(Ext4Helper.Locators.ext4Button("OK")); } @@ -1217,7 +1218,7 @@ private void workbookCreationTest() _helper.goToLabHome(); _helper.clickNavPanelItem("View and Edit Workbooks:", "Create New Workbook"); - waitForElement(Ext4Helper.Locators.window("Create Workbook")); + new Window.WindowFinder(getDriver()).withTitle("Create Workbook").waitFor(); assertElementNotPresent(Ext4Helper.Locators.ext4Radio("Add To Existing Workbook")); waitForElement(Ext4Helper.Locators.ext4Button("Close")); click(Ext4Helper.Locators.ext4Button("Close")); @@ -1248,7 +1249,7 @@ private void workbookCreationTest() sleep(150); //there's a buffer when committing changes clickButton("Submit", 0); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); assertTextPresent("Your upload was successful"); _oligosTotal++; clickButton("OK", 0); @@ -1262,7 +1263,7 @@ private void dnaOligosTableTest() _helper.goToLabHome(); _helper.clickNavPanelItem("DNA_Oligos:", IMPORT_DATA_TEXT); - waitForElement(Ext4Helper.Locators.window(IMPORT_DATA_TEXT)); + new Window.WindowFinder(getDriver()).withTitle(IMPORT_DATA_TEXT).waitFor(); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); waitForElement(Locator.name("purification")); @@ -1276,7 +1277,7 @@ private void dnaOligosTableTest() _helper.goToLabHome(); _helper.clickNavPanelItem("DNA_Oligos:", IMPORT_DATA_TEXT); - waitForElement(Ext4Helper.Locators.window(IMPORT_DATA_TEXT)); + new Window.WindowFinder(getDriver()).withTitle(IMPORT_DATA_TEXT).waitFor(); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); waitForElement(Locator.name("purification")); _ext4Helper.clickTabContainingText("Import Spreadsheet"); @@ -1287,7 +1288,7 @@ private void dnaOligosTableTest() clickButton("Upload", 0); _oligosTotal += 2; - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); assertTextPresent("Success! 2 rows inserted."); clickButton("OK"); @@ -1310,7 +1311,7 @@ private void samplesTableTest() throws Exception _helper.goToLabHome(); _helper.clickNavPanelItem("Samples:", IMPORT_DATA_TEXT); - waitForElement(Ext4Helper.Locators.window(IMPORT_DATA_TEXT)); + new Window.WindowFinder(getDriver()).withTitle(IMPORT_DATA_TEXT).waitFor(); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); waitForElement(Locator.name("samplename")); @@ -1339,7 +1340,7 @@ private void samplesTableTest() throws Exception _helper.setFormField("location", "Location1"); clickButton("Submit", 0); - waitForElement(Ext4Helper.Locators.window("Error")); + new Window.WindowFinder(getDriver()).withTitle("Error").waitFor(); waitForText("Cannot have a negative value for box_row"); clickButton("OK", 0); @@ -1360,7 +1361,7 @@ private void samplesTableTest() throws Exception dr.clickHeaderButton("Insert"); //collapse menu dr.clickHeaderMenu("Insert", false, "Insert New"); - waitForElement(Ext4Helper.Locators.window(IMPORT_DATA_TEXT)); + new Window.WindowFinder(getDriver()).withTitle(IMPORT_DATA_TEXT).waitFor(); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); waitForElement(Locator.name("samplename")); //ensure we're on the correct Ext4 override page verifyFreezerColOrder(); @@ -1389,7 +1390,7 @@ private void samplesTableTest() throws Exception dr.checkCheckbox(1); dr.checkCheckbox(2); dr.clickHeaderMenu("More Actions", false, "Duplicate/Derive Samples"); - waitForElement(Ext4Helper.Locators.window("Duplicate/Derive Samples")); + new Window.WindowFinder(getDriver()).withTitle("Duplicate/Derive Samples").waitFor(); Ext4FieldRef.getForLabel(this, "Copies Per Sample").setValue(2); File downloaded = clickAndWaitForDownload(Ext4Helper.Locators.ext4Button("Submit")); Assert.assertTrue(downloaded.exists()); @@ -1449,7 +1450,7 @@ private void samplesTableTest() throws Exception dr.checkCheckbox(2); dr.clickHeaderMenu("More Actions", false, "Append Comment"); - waitForElement(Ext4Helper.Locators.window("Append Comment")); + new Window.WindowFinder(getDriver()).withTitle("Append Comment").waitFor(); final String comment = "This is text I added"; Ext4FieldRef.getForLabel(this, "Comment").setValue(comment); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); @@ -1465,7 +1466,7 @@ private void samplesTableTest() throws Exception dr.checkCheckbox(1); dr.clickHeaderMenu("More Actions", false, "Append Comment"); - waitForElement(Ext4Helper.Locators.window("Append Comment")); + new Window.WindowFinder(getDriver()).withTitle("Append Comment").waitFor(); Ext4FieldRef.getForLabel(this, "Comment").setValue("This should append to the end"); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); dr = new DataRegionTable.DataRegionFinder(getDriver()).withName("query").find(); @@ -1484,7 +1485,7 @@ private void samplesTableTest() throws Exception sampleId1 = dr.getDataAsText(1, dr.getColumnIndex("freezerid")); sampleId2 = dr.getDataAsText(2, dr.getColumnIndex("freezerid")); dr.clickHeaderMenu("More Actions", false, "Mark Removed"); - waitForElement(Ext4Helper.Locators.window("Mark Removed")); + new Window.WindowFinder(getDriver()).withTitle("Mark Removed").waitFor(); Ext4FieldRef.getForLabel(this, "Date Removed").setValue("2017-01-02"); Ext4FieldRef.getForLabel(this, "Comment").setValue("I removed these samples"); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); @@ -1658,7 +1659,7 @@ private void insertDummySampleRow(String suffix) sleep(150); //there's a buffer when committing changes waitAndClick(Ext4Helper.Locators.ext4ButtonEnabled("Submit")); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); assertTextPresent("Your upload was successful"); _samplesTotal++; waitAndClickAndWait(Ext4Helper.Locators.ext4Button("OK")); @@ -1672,7 +1673,7 @@ private void peptideTableTest() throws Exception _helper.goToLabHome(); _helper.clickNavPanelItem("Peptides:", IMPORT_DATA_TEXT); - waitForElement(Ext4Helper.Locators.window(IMPORT_DATA_TEXT)); + new Window.WindowFinder(getDriver()).withTitle(IMPORT_DATA_TEXT).waitFor(); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("Submit")); waitForElement(Locator.name("sequence")); @@ -1687,7 +1688,7 @@ private void peptideTableTest() throws Exception //test error conditions in trigger script String errorMsg = "Sequence can only contain valid amino acid characters: ARNDCQEGHILKMFPSTWYV*"; - waitForElement(Ext4Helper.Locators.window("Error")); + new Window.WindowFinder(getDriver()).withTitle("Error").waitFor(); assertTextPresent(errorMsg); clickButton("OK", 0); @@ -1695,7 +1696,7 @@ private void peptideTableTest() throws Exception sleep(150); //there's a buffer when committing changes clickButton("Submit", 0); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); assertTextPresent("Your upload was successful"); _peptideTotal = 1; clickButton("OK", 0); @@ -1788,7 +1789,7 @@ private void defaultAssayImportMethodTest() .selectComboBoxItem(defaultVal); waitAndClick(Ext4Helper.Locators.ext4Button("Submit")); - waitForElement(Ext4Helper.Locators.window("Success")); + new Window.WindowFinder(getDriver()).withTitle("Success").waitFor(); waitAndClickAndWait(Ext4Helper.Locators.ext4Button("OK")); waitForText("Types of Data"); _helper.goToAssayResultImport(GENOTYPING_ASSAYNAME, false);