diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/ApplicationRunner.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/ApplicationRunner.java index bfc4b01b0e15bb643ad70772ee86e1c6cc241d0c..d580425dd2d29b67a99eb1f38951780c16a31f76 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/ApplicationRunner.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/ApplicationRunner.java @@ -40,6 +40,8 @@ public interface ApplicationRunner public void logout(); + public String loggedInAs(); + public Space create(Space space); public void delete(Space space); diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/DummyApplicationRunner.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/DummyApplicationRunner.java index 49dcff7114a1a109977b4ba0d050c77358904c14..a6dfdac7baff26bbedfbbbb3165ab9cab18062ce 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/DummyApplicationRunner.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/DummyApplicationRunner.java @@ -153,4 +153,10 @@ public class DummyApplicationRunner implements ApplicationRunner { return null; } + + @Override + public String loggedInAs() + { + return null; + } } \ No newline at end of file diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/GuiApplicationRunner.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/GuiApplicationRunner.java index e9b5592044ca0c8d36203b1dc1c02fc5f16f634f..16359bb2fdfcdc112a06416f64f802079b2e3c6b 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/GuiApplicationRunner.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/GuiApplicationRunner.java @@ -17,6 +17,9 @@ package ch.systemsx.cisd.openbis.uitest.infra.application; import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.openqa.selenium.NoSuchElementException; import ch.systemsx.cisd.openbis.uitest.infra.uid.UidGenerator; import ch.systemsx.cisd.openbis.uitest.infra.webdriver.PageProxy; @@ -51,6 +54,7 @@ import ch.systemsx.cisd.openbis.uitest.page.tab.SampleTypeBrowser; import ch.systemsx.cisd.openbis.uitest.page.tab.SpaceBrowser; import ch.systemsx.cisd.openbis.uitest.page.tab.Trash; import ch.systemsx.cisd.openbis.uitest.page.tab.VocabularyBrowser; +import ch.systemsx.cisd.openbis.uitest.suite.SeleniumTest; import ch.systemsx.cisd.openbis.uitest.type.Browsable; import ch.systemsx.cisd.openbis.uitest.type.DataSet; import ch.systemsx.cisd.openbis.uitest.type.DataSetType; @@ -602,8 +606,43 @@ public class GuiApplicationRunner implements ApplicationRunner return browser; } - private <T> T load(Class<T> clazz) + public <T> T load(Class<T> clazz) { return proxy.get(clazz); } + + public <T> T tryLoad(Class<T> clazz) + { + return tryLoad(clazz, SeleniumTest.IMPLICIT_WAIT, TimeUnit.SECONDS); + } + + public <T> T tryLoad(Class<T> clazz, long timeout, TimeUnit unit) + { + SeleniumTest.setImplicitWait(timeout, unit); + try + { + return load(clazz); + } catch (NoSuchElementException e) + { + e.printStackTrace(); + return null; + } finally + { + SeleniumTest.setImplicitWaitToDefault(); + } + + } + + @Override + public String loggedInAs() + { + TopBar t = tryLoad(TopBar.class); + if (t != null) + { + return t.getUserName(); + } else + { + return null; + } + } } diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/PublicApiApplicationRunner.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/PublicApiApplicationRunner.java index b2a21a1b3aaf46b5b2508a5d58a24a2199a59865..3300c9ed5e08ba6425a9b9d8b7d16441d3059017 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/PublicApiApplicationRunner.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/application/PublicApiApplicationRunner.java @@ -16,6 +16,7 @@ package ch.systemsx.cisd.openbis.uitest.infra.application; +import ch.systemsx.cisd.common.exceptions.InvalidSessionException; import ch.systemsx.cisd.common.spring.HttpInvokerUtils; import ch.systemsx.cisd.openbis.dss.generic.shared.api.v1.IDssServiceRpcGeneric; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; @@ -51,6 +52,8 @@ public class PublicApiApplicationRunner implements ApplicationRunner private String session; + private String lastSuccessfulLogin; + public PublicApiApplicationRunner(String openbisUrl, String dssUrl, UidGenerator uid) { this.uid = uid; @@ -76,9 +79,13 @@ public class PublicApiApplicationRunner implements ApplicationRunner @Override public void login(String userName, String password) { - this.session = + session = commonServer .tryToAuthenticate(userName, password).getSessionToken(); + if (session != null) + { + lastSuccessfulLogin = userName; + } } @Override @@ -160,7 +167,6 @@ public class PublicApiApplicationRunner implements ApplicationRunner @Override public Sample create(Sample sample) { - // TODO Auto-generated method stub return null; } @@ -203,4 +209,17 @@ public class PublicApiApplicationRunner implements ApplicationRunner return dataSetType; } + @Override + public String loggedInAs() + { + try + { + commonServer.checkSession(session); + return lastSuccessfulLogin; + } catch (InvalidSessionException e) + { + return null; + } + } + } diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/CurrentPageMatcher.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/CurrentPageMatcher.java new file mode 100644 index 0000000000000000000000000000000000000000..5ac94c4fcbdf8708ebb654389199cd630ab4dfd1 --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/CurrentPageMatcher.java @@ -0,0 +1,48 @@ +/* + * 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.infra.matcher; + +import org.hamcrest.Description; +import org.hamcrest.TypeSafeMatcher; + +import ch.systemsx.cisd.openbis.uitest.infra.application.GuiApplicationRunner; + +/** + * @author anttil + */ +public class CurrentPageMatcher extends TypeSafeMatcher<GuiApplicationRunner> +{ + + private final Class<?> pageClass; + + public CurrentPageMatcher(Class<?> pageClass) + { + this.pageClass = pageClass; + } + + @Override + public void describeTo(Description description) + { + description.appendText("Browser showing page " + pageClass.getSimpleName()); + } + + @Override + public boolean matchesSafely(GuiApplicationRunner openbis) + { + return openbis.tryLoad(pageClass) != null; + } +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/PageMatcher.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/PageMatcher.java deleted file mode 100644 index 2f2d207970e7f3ff4123c9ecf295627b49760516..0000000000000000000000000000000000000000 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/PageMatcher.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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.infra.matcher; - -import java.lang.reflect.Field; -import java.util.Collection; - -import org.hamcrest.Description; -import org.hamcrest.TypeSafeMatcher; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import ch.systemsx.cisd.openbis.uitest.infra.webdriver.Lazy; -import ch.systemsx.cisd.openbis.uitest.infra.webdriver.PageProxy; - -/** - * @author anttil - */ -public class PageMatcher extends TypeSafeMatcher<WebDriver> -{ - - private Class<?> pageClass; - - private PageProxy pageProxy; - - public PageMatcher(Class<?> pageClass, PageProxy pageProxy) - { - this.pageClass = pageClass; - this.pageProxy = pageProxy; - } - - @Override - public void describeTo(Description description) - { - description.appendText("Browser on page described by " + this.pageClass.getName()); - } - - @Override - public boolean matchesSafely(WebDriver ignore) - { - Object o = pageProxy.get(pageClass); - while (pageClass != null) - { - for (Field field : pageClass.getDeclaredFields()) - { - if ((field.getAnnotation(FindBy.class) != null) - && (field.getAnnotation(Lazy.class) == null)) - { - WebElement element; - try - { - field.setAccessible(true); - Object potentialWebElement = field.get(o); - if (potentialWebElement instanceof Collection) - { - continue; - } - element = (WebElement) potentialWebElement; - } catch (IllegalArgumentException ex) - { - ex.printStackTrace(); - return false; - } catch (IllegalAccessException ex) - { - ex.printStackTrace(); - return false; - } - if (!element.isDisplayed()) - { - return false; - } - } - } - - pageClass = pageClass.getSuperclass(); - } - return true; - } -} \ No newline at end of file diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/TopBar.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/TopBar.java index 1405297b88cd103ac56cfd6cad7fff4ad321ef33..88d89285dc05ed9b4c4b5cc9b27ec0b88000af19 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/TopBar.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/TopBar.java @@ -68,4 +68,9 @@ public class TopBar { newMenu.click(); } + + public String getUserName() + { + return userMenu.getText(); + } } diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleDetails.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleDetails.java new file mode 100644 index 0000000000000000000000000000000000000000..b330e36e7177bfc4b7861c7ba4d007106be98d78 --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleDetails.java @@ -0,0 +1,27 @@ +/* + * 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.page.tab; + +/** + * + * + * @author anttil + */ +public class SampleDetails +{ + +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/AuthorizationTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/AuthorizationTest.java index 2909681a252f1b2ded18fb3207f9cd2dfdebbddf..7a255b1632fd445b252ef161f0679fab201f596f 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/AuthorizationTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/AuthorizationTest.java @@ -1,12 +1,13 @@ package ch.systemsx.cisd.openbis.uitest.suite; +import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.uitest.page.dialog.InvalidPasswordDialog; +import ch.systemsx.cisd.openbis.uitest.page.menu.AdminMenu; import ch.systemsx.cisd.openbis.uitest.page.menu.TopBar; -import ch.systemsx.cisd.openbis.uitest.page.tab.LoginPage; import ch.systemsx.cisd.openbis.uitest.page.tab.RoleAssignmentBrowser; @Test(groups = @@ -17,38 +18,42 @@ public class AuthorizationTest extends SeleniumTest @Test public void loginFailsWithInvalidUserName() throws Exception { - openbis.login("invalid", SeleniumTest.ADMIN_PASSWORD); - get(InvalidPasswordDialog.class).dismiss(); + login("invalid", SeleniumTest.ADMIN_PASSWORD); + + assertThat(browser(), displays(InvalidPasswordDialog.class)); + + assumePage(InvalidPasswordDialog.class).dismiss(); } @Test public void loginFailsWithValidUserNameAndInvalidPassword() throws Exception { - openbis.login(SeleniumTest.ADMIN_USER + "begfga", "invalid"); - get(InvalidPasswordDialog.class).dismiss(); + login(SeleniumTest.ADMIN_USER + "bagfa", "invalid"); + + assertThat(browser(), displays(InvalidPasswordDialog.class)); + + assumePage(InvalidPasswordDialog.class).dismiss(); } @Test public void loginSucceedsWithValidCredentials() throws Exception { - openbis.login(SeleniumTest.ADMIN_USER, SeleniumTest.ADMIN_PASSWORD); - assertThat(browser(), isShowing(TopBar.class)); + login(SeleniumTest.ADMIN_USER, SeleniumTest.ADMIN_PASSWORD); - openbis.logout(); - assertThat(browser(), isShowing(LoginPage.class)); + assertThat(loggedInAs(), is(SeleniumTest.ADMIN_USER)); + + logout(); } @Test public void adminCanOpenRoleAssignmentBrowser() throws Exception { - openbis.login(SeleniumTest.ADMIN_USER, SeleniumTest.ADMIN_PASSWORD); - try - { - openbis.browseToRoleAssignmentBrowser(); - assertThat(browser(), isShowing(RoleAssignmentBrowser.class)); - } finally - { - openbis.logout(); - } + login(SeleniumTest.ADMIN_USER, SeleniumTest.ADMIN_PASSWORD); + assumePage(TopBar.class).admin(); + assumePage(AdminMenu.class).roles(); + + assertThat(browser(), displays(RoleAssignmentBrowser.class)); + + logout(); } -} +} \ No newline at end of file diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SampleTypeTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SampleTypeTest.java index 090232542b8baf4c37636711cc9c9c343d72581d..267de63cfb2d6c96f4cd05717ff95b9974122b11 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SampleTypeTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/suite/SampleTypeTest.java @@ -36,9 +36,9 @@ public class SampleTypeTest extends SeleniumTest { create(aSampleType().withCode("invalid code")); - assertThat(browser(), isShowing(AddSampleTypeDialog.class)); + assertThat(browser(), displays(AddSampleTypeDialog.class)); - get(AddSampleTypeDialog.class).cancel(); + assumePage(AddSampleTypeDialog.class).cancel(); } @Test 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 19e778653bf5e8bced0e6b5a09a2b76f2123da80..af1957b42e23d09dfda6b42746d55a4d0cf17731 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 @@ -43,7 +43,7 @@ import ch.systemsx.cisd.openbis.uitest.infra.application.PublicApiApplicationRun import ch.systemsx.cisd.openbis.uitest.infra.dsl.DslSampleBrowser; import ch.systemsx.cisd.openbis.uitest.infra.matcher.CellContentMatcher; import ch.systemsx.cisd.openbis.uitest.infra.matcher.CollectionContainsMatcher; -import ch.systemsx.cisd.openbis.uitest.infra.matcher.PageMatcher; +import ch.systemsx.cisd.openbis.uitest.infra.matcher.CurrentPageMatcher; import ch.systemsx.cisd.openbis.uitest.infra.matcher.RegisterSampleFormContainsInputsForPropertiesMatcher; import ch.systemsx.cisd.openbis.uitest.infra.matcher.RowExistsMatcher; import ch.systemsx.cisd.openbis.uitest.infra.matcher.SampleHasDataSetsMatcher; @@ -54,6 +54,7 @@ import ch.systemsx.cisd.openbis.uitest.infra.uid.UidGenerator; import ch.systemsx.cisd.openbis.uitest.infra.webdriver.PageProxy; import ch.systemsx.cisd.openbis.uitest.page.tab.BrowserRow; import ch.systemsx.cisd.openbis.uitest.page.tab.RegisterSample; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleDetails; import ch.systemsx.cisd.openbis.uitest.type.Browsable; import ch.systemsx.cisd.openbis.uitest.type.Builder; import ch.systemsx.cisd.openbis.uitest.type.DataSet; @@ -95,7 +96,7 @@ public abstract class SeleniumTest private ScreenShotter shotter; - protected GuiApplicationRunner openbis; + private GuiApplicationRunner openbis; private static ApplicationRunner openbisApi; @@ -211,16 +212,6 @@ public abstract class SeleniumTest shotter.screenshot(); } - public <T> T get(Class<T> clazz) - { - return this.pageProxy.get(clazz); - } - - protected WebDriver browser() - { - return driver; - } - private void delete(File f) { if (f.isDirectory()) @@ -231,6 +222,11 @@ public abstract class SeleniumTest f.delete(); } + protected void login(String user, String password) + { + openbis.login(user, password); + } + protected DslSampleBrowser sampleBrowser() { return new DslSampleBrowser(openbis.browseToSampleBrowser()); @@ -241,6 +237,12 @@ public abstract class SeleniumTest return browsable.getBrowserContent(openbis); } + protected SampleDetails detailsOf(Sample sample) + { + // return openbis.browseToDetailsOf(sample); + return null; + } + protected void emptyTrash() { openbis.emptyTrash(); @@ -252,14 +254,29 @@ public abstract class SeleniumTest return pageProxy.get(RegisterSample.class); } - protected Matcher<Sample> hasDataSets(DataSet... datasets) + public String loggedInAs() { - return new SampleHasDataSetsMatcher(openbis, datasets); + return openbis.loggedInAs(); + } + + public <T> T assumePage(Class<T> pageClass) + { + return openbis.load(pageClass); + } + + public GuiApplicationRunner browser() + { + return openbis; + } + + public Matcher<GuiApplicationRunner> displays(Class<?> pageClass) + { + return new CurrentPageMatcher(pageClass); } - protected Matcher<WebDriver> isShowing(Class<?> pageClass) + protected Matcher<Sample> hasDataSets(DataSet... datasets) { - return new PageMatcher(pageClass, pageProxy); + return new SampleHasDataSetsMatcher(openbis, datasets); } protected Matcher<RegisterSample> hasInputsForProperties(PropertyType... fields) 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 89b3a74b46dc78f1be736de7ecfb83dc37d17540..2e849172abe67fc3e43f00f2c4376e3e9e0123b6 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 @@ -21,6 +21,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.uitest.page.dialog.AddSampleTypeDialog; +import ch.systemsx.cisd.openbis.uitest.page.menu.AdminMenu; +import ch.systemsx.cisd.openbis.uitest.page.menu.TopBar; import ch.systemsx.cisd.openbis.uitest.page.tab.RoleAssignmentBrowser; import ch.systemsx.cisd.openbis.uitest.type.Experiment; import ch.systemsx.cisd.openbis.uitest.type.ExperimentType; @@ -39,7 +41,7 @@ import ch.systemsx.cisd.openbis.uitest.type.Vocabulary; public class SprintTest extends SeleniumTest { - @Test(enabled = false) + @Test public void basic() { // 0) Cleanup @@ -65,8 +67,9 @@ public class SprintTest extends SeleniumTest delete(oldVocabulary); // 1) Login and authorization - openbis.browseToRoleAssignmentBrowser(); - assertThat(browser(), isShowing(RoleAssignmentBrowser.class)); + assumePage(TopBar.class).admin(); + assumePage(AdminMenu.class).roles(); + assertThat(browser(), displays(RoleAssignmentBrowser.class)); // 2) Space Space space = create(aSpace().withCode("sprint-test")); @@ -74,8 +77,8 @@ public class SprintTest extends SeleniumTest // 3) Sample types and properties create(aSampleType().withCode("sprint test")); - assertThat(browser(), isShowing(AddSampleTypeDialog.class)); - get(AddSampleTypeDialog.class).cancel(); + assertThat(browser(), displays(AddSampleTypeDialog.class)); + assumePage(AddSampleTypeDialog.class).cancel(); SampleType sampleType = create(aSampleType() @@ -101,7 +104,6 @@ public class SprintTest extends SeleniumTest .withLabel("Sprint Test Text") .withDescription("some text")); - @SuppressWarnings("unused") PropertyType realPropertyType = create(aRealPropertyType() .withCode("SPRINT-TEST.REAL") @@ -145,5 +147,16 @@ public class SprintTest extends SeleniumTest .withSamples(sample)); assertThat(browserEntryOf(sample), containsValue("Experiment", experiment.getCode())); assertThat(browserEntryOf(sample), containsValue("Project", project.getCode())); + + deleteExperimentsFrom(project); + emptyTrash(); + delete(project); + delete(space); + delete(sampleType); + delete(experimentType); + delete(varcharPropertyType); + delete(realPropertyType); + delete(animalPropertyType); + delete(vocabulary); } } diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/SampleType.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/SampleType.java index db1a205cda5cd5185f545164b98cfb5aa12981e0..89a12e3329edcdcd0ab7b320c1e23e08359677ff 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/SampleType.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/SampleType.java @@ -184,7 +184,7 @@ public class SampleType implements Browsable, EntityType @Override public int hashCode() { - return code.hashCode(); + return code.toUpperCase().hashCode(); } @Override @@ -194,6 +194,6 @@ public class SampleType implements Browsable, EntityType { return false; } - return code.equals(((SampleType) o).getCode()); + return code.equalsIgnoreCase(((SampleType) o).getCode()); } } diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/Button.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/Button.java index 60407ead1a8cadef85ee40a446fc3bd4affa0bb7..8f6674e3344367577e2a227005c37aac242bb2a2 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/Button.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/widget/Button.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.uitest.widget; import ch.systemsx.cisd.openbis.uitest.infra.webdriver.WidgetContext; - /** * @author anttil */ @@ -48,4 +47,9 @@ public class Button implements AtomicWidget { this.context = context; } + + public String getText() + { + return context.getText(); + } }