diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleBrowser.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleBrowser.java index 5cdf7c5c99171e9b92c3ce02baa29e6564ae2872..6fa74e81adb4323412f36631b3411cbd3b46799e 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleBrowser.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleBrowser.java @@ -27,6 +27,7 @@ import ch.systemsx.cisd.openbis.uitest.widget.DropDown; import ch.systemsx.cisd.openbis.uitest.widget.FilterToolBar; import ch.systemsx.cisd.openbis.uitest.widget.Grid; import ch.systemsx.cisd.openbis.uitest.widget.PagingToolBar; +import ch.systemsx.cisd.openbis.uitest.widget.SettingsDialog; public class SampleBrowser implements Browser<Sample> { @@ -50,6 +51,10 @@ public class SampleBrowser implements Browser<Sample> @Locate("openbis_sample-browser_main-grid-filter-toolbar") private FilterToolBar filters; + @Lazy + @Locate("entity-browser-grid-SAMPLE-(all)") + private SettingsDialog settings; + public void addSample() { addSample.click(); @@ -79,7 +84,16 @@ public class SampleBrowser implements Browser<Sample> @Override public BrowserCell cell(Sample sample, String column) { - return select(sample).get(column); + BrowserCell c = select(sample).get(column); + if (c == null) + { + paging.settings(); + settings.showColumns("Code", column); + return select(sample).get(column); + } else + { + return c; + } } @Override diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SeleniumTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SeleniumTest.java index 0f9b5c89c316484cf41220e0be014f9cf5a5d39b..9624208e2d16400897df222d7ca1e2bbaaa1def1 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SeleniumTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SeleniumTest.java @@ -130,6 +130,12 @@ public abstract class SeleniumTest dssUrl = "http://localhost:8889"; } + /* + asUrl = "https://sprint-openbis.ethz.ch/openbis"; + dssUrl = "https://sprint-openbis.ethz.ch"; + startPage = asUrl; + */ + System.out.println("asUrl: " + asUrl); System.out.println("dssUrl: " + dssUrl); System.out.println("startPage: " + startPage); diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SprintTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SprintTest.java index 2b989e517d27bcbfa44c1f16c78fcdf46584e184..137d896da57763bd6f1c91980c796756a9a6264d 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SprintTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SprintTest.java @@ -39,7 +39,7 @@ import ch.systemsx.cisd.openbis.uitest.type.Vocabulary; public class SprintTest extends SeleniumTest { - @Test(enabled = false) + @Test public void basic() { // 0) Cleanup diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/PagingToolBar.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/PagingToolBar.java index b7534c8e0515b03d4a29059e0f6337bc0018904d..79fb53bf9a09913bbe0269e3f8ef7af31eec4f7f 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/PagingToolBar.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/PagingToolBar.java @@ -35,6 +35,15 @@ public class PagingToolBar implements Widget, Refreshable } } + public void settings() + { + Button b = context.find(".//button[text()='Settings']", Button.class); + if (!b.isPressed()) + { + b.click(); + } + } + @Override public void setContext(WidgetContext context) { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/SettingsDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/SettingsDialog.java new file mode 100644 index 0000000000000000000000000000000000000000..04a794fa8e0955abf18f7d4cf6761f4a2d146c0c --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/SettingsDialog.java @@ -0,0 +1,62 @@ +/* + * Copyright 2012 ETH Zuerich, CISD + * + * 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 ch.systemsx.cisd.openbis.uitest.widget; + +import java.util.List; + +import org.openqa.selenium.WebElement; + +import ch.systemsx.cisd.openbis.uitest.infra.webdriver.WidgetContext; + +/** + * @author anttil + */ +public class SettingsDialog implements Widget +{ + + private WidgetContext context; + + public void showColumns(String... columns) + { + + context.find(".//*[text()='No Columns']").click(); + + for (String name : columns) + { + List<WebElement> l = + context.findAll(".//div[text()='" + + name + + "']/../..//div[contains(@class, 'IS_VISIBLE') and not(*)]"); + + System.out.println("SEarching for " + name); + + if (l.size() > 0) + { + System.out.println("Actually clicking " + name); + l.get(0).click(); + } + } + + context.find("//*[@class='x-window-bl']//button[text()='OK']").click(); + } + + @Override + public void setContext(WidgetContext context) + { + this.context = context; + } +}