diff --git a/src/org/labkey/test/pages/assay/SampleTypeImportPage.java b/src/org/labkey/test/pages/assay/SampleTypeImportPage.java deleted file mode 100644 index c9ea63afb2..0000000000 --- a/src/org/labkey/test/pages/assay/SampleTypeImportPage.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.labkey.test.pages.assay; - - -import org.labkey.test.BaseWebDriverTest; -import org.labkey.test.Locator; -import org.labkey.test.pages.LabKeyPage; -import org.labkey.test.selenium.LazyWebElement; -import org.openqa.selenium.WebElement; - -public class SampleTypeImportPage extends LabKeyPage -{ - public SampleTypeImportPage(BaseWebDriverTest test) - { - super(test); - } - - public void insertTsvData(String data, String parentColumn) - { - setFormElement(newElementCache().inputTsvField, data); - setFormElement(newElementCache().parentSelect, parentColumn); - clickButton("Submit"); - } - - @Override - protected Elements newElementCache() - { - return new Elements(); - } - - public class Elements extends LabKeyPage.ElementCache - { - final WebElement inputTsvField = new LazyWebElement(Locator.xpath(".//textarea[@id='textbox']"), this); - - final WebElement parentSelect = new LazyWebElement(Locator.xpath("//select[@id='parentCol']"), this); - - final WebElement downloadTemplateLink = new LazyWebElement(Locator.linkWithText("Download an Excel Template Workbook"), this); - final WebElement submitButton = new LazyWebElement(Locator.lkButton("Submit"), this); - final WebElement clearButton = new LazyWebElement(Locator.lkButton("Clear"), this); - } -} diff --git a/src/org/labkey/test/tests/list/ListTest.java b/src/org/labkey/test/tests/list/ListTest.java index 9c5404850b..16feaf1b84 100644 --- a/src/org/labkey/test/tests/list/ListTest.java +++ b/src/org/labkey/test/tests/list/ListTest.java @@ -535,6 +535,7 @@ public void testLongName() checker().verifyEquals("Default value not as expected ", "42", updatePage.getTextInputValue(fieldWithDefault)); updatePage.submit(); } + /* Issue 51572: Bug with creating a new list by uploading a csv file in "UTF-8 with BOM" format */ @Test @@ -580,7 +581,7 @@ public void testCustomViews() setUpList(getProjectName()); goToProjectHome(); - clickAndWait(Locator.linkWithText(LIST_NAME_COLORS)); + waitAndClickAndWait(Locator.linkWithText(LIST_NAME_COLORS)); log("Test Sort and Filter in Data View"); DataRegionTable region = new DataRegionTable("query", getDriver()); @@ -595,7 +596,7 @@ public void testCustomViews() log("Test Customize View"); // Re-navigate to the list to clear filters and sorts clickTab("List"); - clickAndWait(Locator.linkWithText(LIST_NAME_COLORS)); + waitAndClickAndWait(Locator.linkWithText(LIST_NAME_COLORS)); _customizeViewsHelper.openCustomizeViewPanel(); _customizeViewsHelper.removeColumn(_listColGood.getName()); _customizeViewsHelper.addFilter(_listColGood.getName(), "Is Less Than", "10"); @@ -660,10 +661,19 @@ public void testCustomViews() log("Test list history"); clickAndWait(Locator.linkWithText("manage lists")); - clickAndWait(Locator.linkWithText("view history")); - checker().wrapAssertion(()->assertTextPresent(":History")); - checker().wrapAssertion(()->assertTextPresent("record was modified", 2)); // An existing list record was modified + DataRegionTable drt = new DataRegionTable.DataRegionFinder(getDriver()).find(); + drt.setFilter("Name", "Equals", LIST_NAME_COLORS); + waitFor(()->drt.getDataRowCount()==1, + String.format("DataRegion table did not filter to list %s", LIST_NAME_COLORS), 2_500); + waitAndClickAndWait(Locator.linkWithText("view history")); + // Wait for the header to load on the page. + waitForElementToBeVisible(Locator.tagContainingText("h3", ":History")); + + checker().verifyTrue("DataRegions didn't load.", + waitFor(()->new DataRegionTable.DataRegionFinder(getDriver()).findAll().size() == 2, 3_000)); + + checker().wrapAssertion(()->assertTextPresent("record was modified", 2)); // An existing list record was modified checker().wrapAssertion(()->assertTextPresent(" was created. The column(s) of domain ", 1));// Create domain and update columns combined into a single event checker().wrapAssertion(()->assertTextPresent(" were modified.", 7)); // The column(s) of LIST_NAME_COLORS domain were modified checker().wrapAssertion(()->assertTextPresent("The descriptor of domain", 1)); // The description LIST_NAME_COLORS domain were modified @@ -674,13 +684,16 @@ public void testCustomViews() checker().wrapAssertion(()->assertEquals("details Links", 6/*List Events*/ + 8/*Domain Audit*/, DataRegionTable.detailsLinkLocator().findElements(getDriver()).size())); checker().wrapAssertion(()->assertEquals("Project Links", 17, DataRegionTable.Locators.table().append(Locator.linkWithText(PROJECT_VERIFY)).findElements(getDriver()).size())); checker().wrapAssertion(()->assertEquals("List Links", 17, DataRegionTable.Locators.table().append(Locator.linkWithText(LIST_NAME_COLORS)).findElements(getDriver()).size())); + checker().screenShotIfNewError("List_History_Error"); + DataRegionTable dataRegionTable = new DataRegionTable("query", getDriver()); dataRegionTable.clickRowDetails(0); checker().wrapAssertion(()->assertTextPresent("List Item Details")); checker().wrapAssertion(()->assertTextNotPresent("No details available for this event.", "Unable to find the audit history detail for this event")); + checker().screenShotIfNewError("History_Detail_Error"); clickButton("Done"); - clickAndWait(Locator.linkWithText(PROJECT_VERIFY).index(3)); + waitAndClickAndWait(Locator.linkWithText(PROJECT_VERIFY).index(3)); log("Test single list web part"); new PortalHelper(this).addWebPart("List - Single");