From f66f26986a4fd430e2ff1934ce92841f0d5d1303 Mon Sep 17 00:00:00 2001 From: anttil <anttil> Date: Thu, 6 Sep 2012 11:47:43 +0000 Subject: [PATCH] SWE-2 / SP-263: Property type creation, page objects packaging more fine-grained. SVN: 26528 --- .../web/client/application/menu/TopMenu.java | 1 + .../administration/PropertyTypesMenu.java | 1 + .../openbis/uitest/AuthorizationTest.java | 4 +- .../cisd/openbis/uitest/PropertyTypeTest.java | 43 ++++++++ .../cisd/openbis/uitest/SampleTypeTest.java | 8 +- .../cisd/openbis/uitest/SpaceTest.java | 4 +- .../cisd/openbis/uitest/VocabularyTest.java | 4 +- .../uitest/infra/ApplicationRunner.java | 35 ++++-- .../openbis/uitest/infra/SeleniumTest.java | 7 +- .../cisd/openbis/uitest/page/Page.java | 17 +++ .../cisd/openbis/uitest/page/PrivatePage.java | 4 + .../page/{ => dialog}/AddSampleDialog.java | 4 +- .../{ => dialog}/AddSampleTypeDialog.java | 6 +- .../page/{ => dialog}/AddSpaceDialog.java | 6 +- .../{ => dialog}/AddVocabularyDialog.java | 6 +- .../{ => dialog}/EditSampleTypeDialog.java | 6 +- .../{ => dialog}/InvalidPasswordDialog.java | 5 +- .../uitest/page/{ => menu}/AdminMenu.java | 16 ++- .../page/{ => menu}/AuthorizationMenu.java | 5 +- .../uitest/page/{ => menu}/BrowseMenu.java | 5 +- .../uitest/page/menu/MetadataMenu.java | 36 +++++++ .../uitest/page/{ => menu}/UserMenu.java | 5 +- .../uitest/page/tab/AddPropertyType.java | 75 +++++++++++++ .../page/{ => tab}/RoleAssignmentBrowser.java | 4 +- .../uitest/page/{ => tab}/SampleBrowser.java | 17 ++- .../page/{ => tab}/SampleTypeBrowser.java | 7 +- .../uitest/page/{ => tab}/SpaceBrowser.java | 5 +- .../page/{ => tab}/VocabularyBrowser.java | 5 +- .../type/BasicPropertyTypeDataType.java | 46 ++++++++ ...trolledVocabularyPropertyTypeDataType.java | 43 ++++++++ .../openbis/uitest/type/PropertyType.java | 101 ++++++++++++++++++ .../uitest/type/PropertyTypeDataType.java | 25 +++++ .../uitest/{infra => type}/SampleType.java | 4 +- .../openbis/uitest/{infra => type}/Space.java | 4 +- .../uitest/{infra => type}/Vocabulary.java | 4 +- 35 files changed, 513 insertions(+), 55 deletions(-) create mode 100644 ui-test/source/java/ch/systemsx/cisd/openbis/uitest/PropertyTypeTest.java rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => dialog}/AddSampleDialog.java (86%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => dialog}/AddSampleTypeDialog.java (94%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => dialog}/AddSpaceDialog.java (86%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => dialog}/AddVocabularyDialog.java (88%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => dialog}/EditSampleTypeDialog.java (93%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => dialog}/InvalidPasswordDialog.java (85%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => menu}/AdminMenu.java (77%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => menu}/AuthorizationMenu.java (84%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => menu}/BrowseMenu.java (84%) create mode 100644 ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/MetadataMenu.java rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => menu}/UserMenu.java (84%) create mode 100644 ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/AddPropertyType.java rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => tab}/RoleAssignmentBrowser.java (93%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => tab}/SampleBrowser.java (87%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => tab}/SampleTypeBrowser.java (87%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => tab}/SpaceBrowser.java (90%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/{ => tab}/VocabularyBrowser.java (90%) create mode 100644 ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/BasicPropertyTypeDataType.java create mode 100644 ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/ControlledVocabularyPropertyTypeDataType.java create mode 100644 ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyType.java create mode 100644 ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeDataType.java rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/{infra => type}/SampleType.java (97%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/{infra => type}/Space.java (93%) rename ui-test/source/java/ch/systemsx/cisd/openbis/uitest/{infra => type}/Vocabulary.java (95%) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java index 80b573230e6..7db6fdf26f2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java @@ -51,6 +51,7 @@ public class TopMenu extends LayoutContainer { ADMINISTRATION_MENU_MANAGE_GROUPS, ADMINISTRATION_MENU_MANAGE_TYPES, + ADMINISTRATION_MENU_MANAGE_PROPERTY_TYPES, ADMINISTRATION_MENU_MANAGE_AUTHORIZATION, AUTHORIZATION_MENU_USERS, AUTHORIZATION_MENU_ROLES, diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/administration/PropertyTypesMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/administration/PropertyTypesMenu.java index 14a9c85f272..4d4fe997eed 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/administration/PropertyTypesMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/administration/PropertyTypesMenu.java @@ -36,6 +36,7 @@ public class PropertyTypesMenu extends MenuItem public PropertyTypesMenu(IMessageProvider messageProvider, ComponentProvider componentProvider) { super(messageProvider.getMessage(Dict.MENU_PROPERTY_TYPES)); + setId(TopMenu.ActionMenuKind.ADMINISTRATION_MENU_MANAGE_PROPERTY_TYPES.toString()); Menu menu = new Menu(); menu.add(new ActionMenu(TopMenu.ActionMenuKind.PROPERTY_TYPES_MENU_BROWSE_PROPERTY_TYPES, diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/AuthorizationTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/AuthorizationTest.java index 07bd9360e3e..4fb27c59f60 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/AuthorizationTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/AuthorizationTest.java @@ -7,9 +7,9 @@ import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.uitest.infra.SeleniumTest; import ch.systemsx.cisd.openbis.uitest.infra.User; import ch.systemsx.cisd.openbis.uitest.page.HomePage; -import ch.systemsx.cisd.openbis.uitest.page.InvalidPasswordDialog; import ch.systemsx.cisd.openbis.uitest.page.LoginPage; -import ch.systemsx.cisd.openbis.uitest.page.RoleAssignmentBrowser; +import ch.systemsx.cisd.openbis.uitest.page.dialog.InvalidPasswordDialog; +import ch.systemsx.cisd.openbis.uitest.page.tab.RoleAssignmentBrowser; @Test(groups = { "no-login" }) diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/PropertyTypeTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/PropertyTypeTest.java new file mode 100644 index 00000000000..a7a8c5b3fb0 --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/PropertyTypeTest.java @@ -0,0 +1,43 @@ +/* + * 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; + +import org.testng.annotations.Test; + +import ch.systemsx.cisd.openbis.uitest.infra.SeleniumTest; +import ch.systemsx.cisd.openbis.uitest.type.PropertyType; + +/** + * @author anttil + */ +@Test(groups = + { "login-admin" }) +public class PropertyTypeTest extends SeleniumTest +{ + @Test + public void newPropertyTypeIsListedInPropertyTypeBrowser() throws Exception + { + + PropertyType propertyType = new PropertyType(); + + openbis.create(propertyType); + + /* + assertThat(PropertyTypeBrowser.class, listsPropertyType(propertyType)); + */ + } +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTypeTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTypeTest.java index d72595bcba5..891c30f70f3 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTypeTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTypeTest.java @@ -20,11 +20,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.uitest.infra.SampleType; import ch.systemsx.cisd.openbis.uitest.infra.SeleniumTest; -import ch.systemsx.cisd.openbis.uitest.page.AddSampleTypeDialog; -import ch.systemsx.cisd.openbis.uitest.page.SampleBrowser; -import ch.systemsx.cisd.openbis.uitest.page.SampleTypeBrowser; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddSampleTypeDialog; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleBrowser; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleTypeBrowser; +import ch.systemsx.cisd.openbis.uitest.type.SampleType; /** * @author anttil diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SpaceTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SpaceTest.java index ce685841d9b..cac62743652 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SpaceTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SpaceTest.java @@ -5,8 +5,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.uitest.infra.SeleniumTest; -import ch.systemsx.cisd.openbis.uitest.infra.Space; -import ch.systemsx.cisd.openbis.uitest.page.SpaceBrowser; +import ch.systemsx.cisd.openbis.uitest.page.tab.SpaceBrowser; +import ch.systemsx.cisd.openbis.uitest.type.Space; @Test(groups = { "login-admin" }) diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/VocabularyTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/VocabularyTest.java index 337ad18adf9..691371056c2 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/VocabularyTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/VocabularyTest.java @@ -5,8 +5,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import org.testng.annotations.Test; import ch.systemsx.cisd.openbis.uitest.infra.SeleniumTest; -import ch.systemsx.cisd.openbis.uitest.infra.Vocabulary; -import ch.systemsx.cisd.openbis.uitest.page.VocabularyBrowser; +import ch.systemsx.cisd.openbis.uitest.page.tab.VocabularyBrowser; +import ch.systemsx.cisd.openbis.uitest.type.Vocabulary; @Test(groups = { "login-admin" }) diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/ApplicationRunner.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/ApplicationRunner.java index 9cacecda26c..a572a7793e0 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/ApplicationRunner.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/ApplicationRunner.java @@ -16,17 +16,22 @@ package ch.systemsx.cisd.openbis.uitest.infra; -import ch.systemsx.cisd.openbis.uitest.page.AddSampleTypeDialog; -import ch.systemsx.cisd.openbis.uitest.page.AddSpaceDialog; -import ch.systemsx.cisd.openbis.uitest.page.AddVocabularyDialog; -import ch.systemsx.cisd.openbis.uitest.page.EditSampleTypeDialog; import ch.systemsx.cisd.openbis.uitest.page.LoginPage; import ch.systemsx.cisd.openbis.uitest.page.PrivatePage; -import ch.systemsx.cisd.openbis.uitest.page.RoleAssignmentBrowser; -import ch.systemsx.cisd.openbis.uitest.page.SampleBrowser; -import ch.systemsx.cisd.openbis.uitest.page.SampleTypeBrowser; -import ch.systemsx.cisd.openbis.uitest.page.SpaceBrowser; -import ch.systemsx.cisd.openbis.uitest.page.VocabularyBrowser; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddSampleTypeDialog; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddSpaceDialog; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddVocabularyDialog; +import ch.systemsx.cisd.openbis.uitest.page.dialog.EditSampleTypeDialog; +import ch.systemsx.cisd.openbis.uitest.page.tab.AddPropertyType; +import ch.systemsx.cisd.openbis.uitest.page.tab.RoleAssignmentBrowser; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleBrowser; +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.VocabularyBrowser; +import ch.systemsx.cisd.openbis.uitest.type.PropertyType; +import ch.systemsx.cisd.openbis.uitest.type.SampleType; +import ch.systemsx.cisd.openbis.uitest.type.Space; +import ch.systemsx.cisd.openbis.uitest.type.Vocabulary; /** * @author anttil @@ -62,6 +67,13 @@ public class ApplicationRunner dialog.save(); } + public void create(PropertyType propertyType) + { + AddPropertyType dialog = browseToAddPropertyType(); + dialog.fillWith(propertyType); + dialog.save(); + } + public void update(SampleType sampleType) { SampleTypeBrowser sampleTypeBrowser = browseToSampleTypeBrowser(); @@ -127,6 +139,11 @@ public class ApplicationRunner return browseToVocabularyBrowser().add(); } + public AddPropertyType browseToAddPropertyType() + { + return getMenus().admin().metadata().newPropertyType(); + } + public void closeAllTabs() { getMenus().closeTabs(); diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/SeleniumTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/SeleniumTest.java index cedac6e3391..1f82f86c178 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/SeleniumTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/SeleniumTest.java @@ -43,7 +43,8 @@ import org.testng.annotations.BeforeSuite; import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; import ch.systemsx.cisd.openbis.uitest.page.Page; -import ch.systemsx.cisd.openbis.uitest.page.SampleBrowser; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleBrowser; +import ch.systemsx.cisd.openbis.uitest.type.SampleType; public abstract class SeleniumTest { @@ -58,12 +59,12 @@ public abstract class SeleniumTest @BeforeSuite public void initWebDriver() { - /* + System.setProperty("webdriver.firefox.bin", "/Users/anttil/Desktop/Firefox 10.app/Contents/MacOS/firefox"); System.setProperty("webdriver.firefox.profile", "default"); - */ + driver = new FirefoxDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); delete(new File("targets/dist")); diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/Page.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/Page.java index b65bfcfab48..2b9ddfcd1e6 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/Page.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/Page.java @@ -22,6 +22,7 @@ import static org.hamcrest.Matchers.notNullValue; import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; import org.openqa.selenium.By; @@ -103,4 +104,20 @@ public abstract class Page new WebDriverWait(SeleniumTest.driver, 10).until(condition); } + + protected void select(Collection<? extends WebElement> choices, String text) + { + Collection<String> found = new HashSet<String>(); + for (WebElement choice : choices) + { + if (choice.getText().equals(text)) + { + choice.click(); + return; + } + found.add(choice.getText()); + } + throw new IllegalArgumentException("Selection " + text + " not found"); + + } } diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/PrivatePage.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/PrivatePage.java index 78ccb41b560..db11d28c0d3 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/PrivatePage.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/PrivatePage.java @@ -21,6 +21,10 @@ import java.util.List; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import ch.systemsx.cisd.openbis.uitest.page.menu.AdminMenu; +import ch.systemsx.cisd.openbis.uitest.page.menu.BrowseMenu; +import ch.systemsx.cisd.openbis.uitest.page.menu.UserMenu; + /** * @author anttil */ diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSampleDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSampleDialog.java similarity index 86% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSampleDialog.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSampleDialog.java index 91c940bd1cf..857f5f5bb04 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSampleDialog.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSampleDialog.java @@ -14,7 +14,9 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.dialog; + +import ch.systemsx.cisd.openbis.uitest.page.Page; public class AddSampleDialog extends Page diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSampleTypeDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSampleTypeDialog.java similarity index 94% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSampleTypeDialog.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSampleTypeDialog.java index bac2c1a76ca..e09124a419e 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSampleTypeDialog.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSampleTypeDialog.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.dialog; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; -import ch.systemsx.cisd.openbis.uitest.infra.SampleType; +import ch.systemsx.cisd.openbis.uitest.page.Page; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleTypeBrowser; +import ch.systemsx.cisd.openbis.uitest.type.SampleType; public class AddSampleTypeDialog extends Page { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSpaceDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSpaceDialog.java similarity index 86% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSpaceDialog.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSpaceDialog.java index 6b5ff4165c8..d48036d5a90 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddSpaceDialog.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddSpaceDialog.java @@ -14,12 +14,14 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.dialog; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; -import ch.systemsx.cisd.openbis.uitest.infra.Space; +import ch.systemsx.cisd.openbis.uitest.page.Page; +import ch.systemsx.cisd.openbis.uitest.page.tab.SpaceBrowser; +import ch.systemsx.cisd.openbis.uitest.type.Space; public class AddSpaceDialog extends Page { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddVocabularyDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddVocabularyDialog.java similarity index 88% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddVocabularyDialog.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddVocabularyDialog.java index 32f04e6c4a6..b39ba701fcc 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AddVocabularyDialog.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddVocabularyDialog.java @@ -14,12 +14,14 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.dialog; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; -import ch.systemsx.cisd.openbis.uitest.infra.Vocabulary; +import ch.systemsx.cisd.openbis.uitest.page.Page; +import ch.systemsx.cisd.openbis.uitest.page.tab.VocabularyBrowser; +import ch.systemsx.cisd.openbis.uitest.type.Vocabulary; public class AddVocabularyDialog extends Page { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/EditSampleTypeDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/EditSampleTypeDialog.java similarity index 93% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/EditSampleTypeDialog.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/EditSampleTypeDialog.java index 08e4670a0b8..56dffecb31a 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/EditSampleTypeDialog.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/EditSampleTypeDialog.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.dialog; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; -import ch.systemsx.cisd.openbis.uitest.infra.SampleType; +import ch.systemsx.cisd.openbis.uitest.page.Page; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleTypeBrowser; +import ch.systemsx.cisd.openbis.uitest.type.SampleType; public class EditSampleTypeDialog extends Page { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/InvalidPasswordDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/InvalidPasswordDialog.java similarity index 85% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/InvalidPasswordDialog.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/InvalidPasswordDialog.java index 70f2299f43a..1ec0e486be8 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/InvalidPasswordDialog.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/InvalidPasswordDialog.java @@ -14,11 +14,14 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.dialog; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import ch.systemsx.cisd.openbis.uitest.page.LoginPage; +import ch.systemsx.cisd.openbis.uitest.page.Page; + public class InvalidPasswordDialog extends Page { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AdminMenu.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/AdminMenu.java similarity index 77% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AdminMenu.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/AdminMenu.java index 723074f298f..1fdb40aacc2 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AdminMenu.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/AdminMenu.java @@ -14,13 +14,17 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.menu; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.FindBy; import ch.systemsx.cisd.openbis.uitest.infra.SeleniumTest; +import ch.systemsx.cisd.openbis.uitest.page.PrivatePage; +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.VocabularyBrowser; public class AdminMenu extends PrivatePage { @@ -34,6 +38,9 @@ public class AdminMenu extends PrivatePage @FindBy(id = "ADMINISTRATION_MENU_MANAGE_TYPES") private WebElement types; + @FindBy(id = "ADMINISTRATION_MENU_MANAGE_PROPERTY_TYPES") + private WebElement metadata; + @FindBy(id = "openbis_top-menu_SAMPLE_MENU_TYPES") private WebElement sampleTypes; @@ -59,6 +66,13 @@ public class AdminMenu extends PrivatePage return get(AdminMenu.class); } + public MetadataMenu metadata() + { + Actions builder = new Actions(SeleniumTest.driver); + builder.moveToElement(metadata).build().perform(); + return get(MetadataMenu.class); + } + public SampleTypeBrowser sampleTypes() { sampleTypes.click(); diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AuthorizationMenu.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/AuthorizationMenu.java similarity index 84% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AuthorizationMenu.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/AuthorizationMenu.java index a1aa3029ab7..b46e475b1f3 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/AuthorizationMenu.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/AuthorizationMenu.java @@ -14,11 +14,14 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.menu; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import ch.systemsx.cisd.openbis.uitest.page.PrivatePage; +import ch.systemsx.cisd.openbis.uitest.page.tab.RoleAssignmentBrowser; + public class AuthorizationMenu extends PrivatePage { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/BrowseMenu.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/BrowseMenu.java similarity index 84% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/BrowseMenu.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/BrowseMenu.java index 005abdc7527..0a7c60c8660 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/BrowseMenu.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/BrowseMenu.java @@ -14,11 +14,14 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.menu; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import ch.systemsx.cisd.openbis.uitest.page.PrivatePage; +import ch.systemsx.cisd.openbis.uitest.page.tab.SampleBrowser; + public class BrowseMenu extends PrivatePage { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/MetadataMenu.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/MetadataMenu.java new file mode 100644 index 00000000000..de2ffc98a26 --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/MetadataMenu.java @@ -0,0 +1,36 @@ +/* + * 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.menu; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import ch.systemsx.cisd.openbis.uitest.page.PrivatePage; +import ch.systemsx.cisd.openbis.uitest.page.tab.AddPropertyType; + +public class MetadataMenu extends PrivatePage +{ + + @FindBy(id = "openbis_top-menu_PROPERTY_TYPES_MENU_NEW_PROPERTY_TYPES") + private WebElement newPropertyType; + + public AddPropertyType newPropertyType() + { + newPropertyType.click(); + return get(AddPropertyType.class); + } +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/UserMenu.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/UserMenu.java similarity index 84% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/UserMenu.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/UserMenu.java index 435333732af..ae12d914496 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/UserMenu.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/menu/UserMenu.java @@ -14,11 +14,14 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.menu; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import ch.systemsx.cisd.openbis.uitest.page.LoginPage; +import ch.systemsx.cisd.openbis.uitest.page.PrivatePage; + public class UserMenu extends PrivatePage { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/AddPropertyType.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/AddPropertyType.java new file mode 100644 index 00000000000..05b777b2a87 --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/AddPropertyType.java @@ -0,0 +1,75 @@ +/* + * 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; + +import java.util.List; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.FindBys; + +import ch.systemsx.cisd.openbis.uitest.page.Page; +import ch.systemsx.cisd.openbis.uitest.type.PropertyType; + +public class AddPropertyType extends Page +{ + + @FindBy(id = "openbis_property-type-registration_form_code-input") + private WebElement code; + + @FindBy(id = "openbis_property-type-registration_form_label-input") + private WebElement label; + + @FindBy(id = "openbis_property-type-registration_form_description-input") + private WebElement description; + + @FindBys( + { + @FindBy(id = "openbis_select_data-type"), + @FindBy(xpath = "img") }) + private WebElement dataTypeDropDownOpener; + + @FindBy(className = "x-combo-list-item") + private List<WebElement> dataTypeChoices; + + @FindBys( + { + @FindBy(id = "openbis_select_vocabulary-select"), + @FindBy(xpath = "img") }) + private WebElement vocabularyDropDownOpener; + + @FindBy(className = "x-combo-list-item") + private List<WebElement> vocabularyChoices; + + @FindBy(id = "openbis_property-type-registration_formsave-button") + private WebElement saveButton; + + public void fillWith(PropertyType propertyType) + { + this.code.sendKeys(propertyType.getCode()); + this.label.sendKeys(propertyType.getLabel()); + this.description.sendKeys(propertyType.getDescription()); + this.dataTypeDropDownOpener.click(); + select(dataTypeChoices, propertyType.getDataType().getName()); + } + + public AddPropertyType save() + { + this.saveButton.click(); + return get(AddPropertyType.class); + } +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/RoleAssignmentBrowser.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/RoleAssignmentBrowser.java similarity index 93% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/RoleAssignmentBrowser.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/RoleAssignmentBrowser.java index 7b5a106d2e0..e4fd8b39ff7 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/RoleAssignmentBrowser.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/RoleAssignmentBrowser.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.tab; import java.util.List; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; + public class RoleAssignmentBrowser extends BrowserPage { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SampleBrowser.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleBrowser.java similarity index 87% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SampleBrowser.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleBrowser.java index c2083f8ec66..52c1cdbe9c5 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SampleBrowser.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleBrowser.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.tab; import java.util.ArrayList; import java.util.List; @@ -23,6 +23,9 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; +import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddSampleDialog; + public class SampleBrowser extends BrowserPage { @@ -71,16 +74,8 @@ public class SampleBrowser extends BrowserPage public SampleBrowser selectSampleType(String sampleType) { sampleTypeList.click(); - for (WebElement choice : choices) - { - if (choice.getText().equals(sampleType)) - { - choice.click(); - return get(SampleBrowser.class); - } - } - - throw new RuntimeException("Sample type with name " + sampleType + " not found"); + select(choices, sampleType); + return get(SampleBrowser.class); } public List<String> getSampleTypes() diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SampleTypeBrowser.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleTypeBrowser.java similarity index 87% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SampleTypeBrowser.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleTypeBrowser.java index d462dde9ed1..75e02e0bd54 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SampleTypeBrowser.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SampleTypeBrowser.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.tab; import java.util.List; @@ -22,7 +22,10 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; -import ch.systemsx.cisd.openbis.uitest.infra.SampleType; +import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddSampleTypeDialog; +import ch.systemsx.cisd.openbis.uitest.page.dialog.EditSampleTypeDialog; +import ch.systemsx.cisd.openbis.uitest.type.SampleType; public class SampleTypeBrowser extends BrowserPage { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SpaceBrowser.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SpaceBrowser.java similarity index 90% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SpaceBrowser.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SpaceBrowser.java index cdfdb0c64d0..f6d41ea7a66 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/SpaceBrowser.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/SpaceBrowser.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.tab; import java.util.List; @@ -22,6 +22,9 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; +import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddSpaceDialog; + public class SpaceBrowser extends BrowserPage { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/VocabularyBrowser.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/VocabularyBrowser.java similarity index 90% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/VocabularyBrowser.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/VocabularyBrowser.java index 68588df30a8..55d202eb48b 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/VocabularyBrowser.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/tab/VocabularyBrowser.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.page; +package ch.systemsx.cisd.openbis.uitest.page.tab; import java.util.List; @@ -22,6 +22,9 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; +import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; +import ch.systemsx.cisd.openbis.uitest.page.dialog.AddVocabularyDialog; + public class VocabularyBrowser extends BrowserPage { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/BasicPropertyTypeDataType.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/BasicPropertyTypeDataType.java new file mode 100644 index 00000000000..109b3549dce --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/BasicPropertyTypeDataType.java @@ -0,0 +1,46 @@ +/* + * 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.type; + +/** + * @author anttil + */ +public enum BasicPropertyTypeDataType implements PropertyTypeDataType +{ + BOOLEAN("BOOLEAN"), + HYPERLINK("HYPERLINK"), + INTEGER("INTEGER"), + MATERIAL("MATERIAL"), + MULTILINE_VARCHAR("MULTILINE_VARCHAR"), + REAL("REAL"), + TIMESTAMP("TIMESTAMP"), + VARCHAR("VARCHAR"), + XML("XML"); + + private String name; + + private BasicPropertyTypeDataType(String name) + { + this.name = name; + } + + @Override + public String getName() + { + return this.name; + } +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/ControlledVocabularyPropertyTypeDataType.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/ControlledVocabularyPropertyTypeDataType.java new file mode 100644 index 00000000000..5aafc31c6d5 --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/ControlledVocabularyPropertyTypeDataType.java @@ -0,0 +1,43 @@ +/* + * 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.type; + +/** + * @author anttil + */ +public class ControlledVocabularyPropertyTypeDataType implements PropertyTypeDataType +{ + + private String vocabularyCode; + + public ControlledVocabularyPropertyTypeDataType(String vocabularyCode) + { + this.vocabularyCode = vocabularyCode; + } + + @Override + public String getName() + { + return "CONTROLLEDVOCABULARY"; + } + + public String getVocabularyCode() + { + return vocabularyCode; + } + +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyType.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyType.java new file mode 100644 index 00000000000..8168bb558ff --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyType.java @@ -0,0 +1,101 @@ +/* + * 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.type; + +import java.util.Map; +import java.util.UUID; + +import ch.systemsx.cisd.openbis.uitest.infra.Browsable; + +/** + * @author anttil + */ +public class PropertyType implements Browsable +{ + + private String code; + + private String label; + + private String description; + + private PropertyTypeDataType dataType; + + public PropertyType() + { + this.code = UUID.randomUUID().toString(); + this.label = "label"; + this.description = "description"; + this.dataType = BasicPropertyTypeDataType.BOOLEAN; + } + + public String getCode() + { + return code; + } + + public PropertyType setCode(String code) + { + this.code = code; + return this; + } + + public String getLabel() + { + return label; + } + + public PropertyType setLabel(String label) + { + this.label = label; + return this; + } + + public String getDescription() + { + return description; + } + + public PropertyType setDescription(String description) + { + this.description = description; + return this; + } + + public PropertyTypeDataType getDataType() + { + return dataType; + } + + public PropertyType setDataType(PropertyTypeDataType dataType) + { + this.dataType = dataType; + return this; + } + + @Override + public boolean isRepresentedBy(Map<String, String> row) + { + return this.code.equalsIgnoreCase(row.get("Code")); + } + + @Override + public String toString() + { + return "PropertyType " + this.code; + } +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeDataType.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeDataType.java new file mode 100644 index 00000000000..b2685fd31ef --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeDataType.java @@ -0,0 +1,25 @@ +/* + * 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.type; + +/** + * @author anttil + */ +public interface PropertyTypeDataType +{ + public String getName(); +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/SampleType.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/SampleType.java similarity index 97% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/SampleType.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/SampleType.java index dc89a1f8e9c..191c2513370 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/SampleType.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/SampleType.java @@ -14,11 +14,13 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.infra; +package ch.systemsx.cisd.openbis.uitest.type; import java.util.Map; import java.util.UUID; +import ch.systemsx.cisd.openbis.uitest.infra.Browsable; + /** * @author anttil */ diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Space.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Space.java similarity index 93% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Space.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Space.java index 7cfe68aeccd..c7c5c337008 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Space.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Space.java @@ -14,11 +14,13 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.infra; +package ch.systemsx.cisd.openbis.uitest.type; import java.util.Map; import java.util.UUID; +import ch.systemsx.cisd.openbis.uitest.infra.Browsable; + /** * @author anttil */ diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Vocabulary.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Vocabulary.java similarity index 95% rename from ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Vocabulary.java rename to ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Vocabulary.java index 98132e943cd..06a3c498f77 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Vocabulary.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Vocabulary.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.uitest.infra; +package ch.systemsx.cisd.openbis.uitest.type; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.UUID; +import ch.systemsx.cisd.openbis.uitest.infra.Browsable; + /** * @author anttil */ -- GitLab