diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTest.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTest.java index 19dc41b684e3584a28aa94629a8ff7c0d55c7547..579cac00e38e362c3d450ee53981e6b2784255f9 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTest.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/SampleTest.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.uitest; -import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import org.testng.annotations.Test; @@ -78,9 +77,8 @@ public class SampleTest extends SeleniumTest Sample sample = create(aSample().ofType(sampleType).withProperty(vocabularyType, "mouse")); - assertThat(true, is(true)); - // assertThat(sampleBrowser().getDataOf(sample), - // containsLink("http://ask.com/web?q=mouse")); + assertThat(sampleBrowser().allSpaces().dataOf(sample).get(vocabularyType.getLabel()), + containsLink("MOUSE", "http://www.ask.com/web?q=MOUSE")); } diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Browsable.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Browsable.java index b956ad9579dfa178482976446858c658839ebf6e..31522034ed4a721595efe81bf2c40267fa38fcf4 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Browsable.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/Browsable.java @@ -18,12 +18,14 @@ package ch.systemsx.cisd.openbis.uitest.infra; import java.util.Map; +import ch.systemsx.cisd.openbis.uitest.page.Cell; + /** * @author anttil */ public interface Browsable { - public boolean isRepresentedBy(Map<String, String> row); + public boolean isRepresentedBy(Map<String, Cell> row); } 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 ba92e9b1dc9484be8da9d5938a57213e9ca87439..743b6d1376ef16ca060287c548127a4dfb7650bb 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 @@ -35,10 +35,12 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeSuite; import ch.systemsx.cisd.openbis.uitest.infra.matcher.BrowserListsElementMatcher; +import ch.systemsx.cisd.openbis.uitest.infra.matcher.CellContainsLinkMatcher; import ch.systemsx.cisd.openbis.uitest.infra.matcher.PageMatcher; import ch.systemsx.cisd.openbis.uitest.infra.matcher.RegisterSampleFormContainsInputsForPropertiesMatcher; import ch.systemsx.cisd.openbis.uitest.infra.matcher.SampleBrowserSampleTypeDropDownMenuMatcher; import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; +import ch.systemsx.cisd.openbis.uitest.page.Cell; import ch.systemsx.cisd.openbis.uitest.page.Page; import ch.systemsx.cisd.openbis.uitest.page.tab.PropertyTypeAssignmentBrowser; import ch.systemsx.cisd.openbis.uitest.page.tab.PropertyTypeBrowser; @@ -63,6 +65,8 @@ import ch.systemsx.cisd.openbis.uitest.type.VocabularyBuilder; public abstract class SeleniumTest { + public static int IMPLICIT_WAIT = 20; + public static WebDriver driver; private PageProxy pageProxy; @@ -81,7 +85,7 @@ public abstract class SeleniumTest System.setProperty("webdriver.firefox.profile", "default"); */ driver = new FirefoxDriver(); - driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); + driver.manage().timeouts().implicitlyWait(IMPLICIT_WAIT, TimeUnit.SECONDS); delete(new File("targets/dist")); driver.manage().deleteAllCookies(); @@ -114,7 +118,7 @@ public abstract class SeleniumTest })); openbis.login(User.ADMIN); - // this is here because of space dropdown does not work properly soon after login + // this is because of BIS-184 sampleBrowser().allSpaces(); } @@ -227,6 +231,11 @@ public abstract class SeleniumTest return new RegisterSampleFormContainsInputsForPropertiesMatcher(fields); } + protected Matcher<Cell> containsLink(String text, String url) + { + return new CellContainsLinkMatcher(text, url); + } + protected <T> T create(Builder<T> builder) { return builder.build(); diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/BrowserListsElementMatcher.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/BrowserListsElementMatcher.java index 79cc3f3681aa7f714894371ee7dc2cd82146edee..73ced742d95b0a14ae5ac0303e20ffda8f694354 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/BrowserListsElementMatcher.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/BrowserListsElementMatcher.java @@ -23,6 +23,7 @@ import org.hamcrest.TypeSafeMatcher; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; import ch.systemsx.cisd.openbis.uitest.page.BrowserPage; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -46,7 +47,7 @@ public class BrowserListsElementMatcher extends @Override public boolean matchesSafely(BrowserPage browser) { - for (Map<String, String> row : browser.getTableContent()) + for (Map<String, Cell> row : browser.getTableContent()) { if (this.expected.isRepresentedBy(row)) { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/CellContainsLinkMatcher.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/CellContainsLinkMatcher.java new file mode 100644 index 0000000000000000000000000000000000000000..f9afc3543c6b432032be7a748f7c5dd2a5f577a9 --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/infra/matcher/CellContainsLinkMatcher.java @@ -0,0 +1,49 @@ +/* + * 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.page.Cell; + +/** + * @author anttil + */ +public class CellContainsLinkMatcher extends TypeSafeMatcher<Cell> +{ + + private Cell expected; + + public CellContainsLinkMatcher(String text, String url) + { + expected = new Cell(text, url); + } + + @Override + public void describeTo(Description description) + { + description.appendText(this.expected.toString()); + } + + @Override + public boolean matchesSafely(Cell item) + { + return expected.equals(item); + } + +} diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/BrowserPage.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/BrowserPage.java index 04b1fad63ffe2fc0d41d9aa1ec9fd69862e6b17d..8af404a7792626beb006919746b71eed5dff63f0 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/BrowserPage.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/BrowserPage.java @@ -27,6 +27,7 @@ import java.util.Map; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; +import ch.systemsx.cisd.openbis.uitest.infra.Browsable; import ch.systemsx.cisd.openbis.uitest.infra.SeleniumTest; /** @@ -52,31 +53,51 @@ public abstract class BrowserPage extends NavigationPage return visibleElements; } - public Collection<Map<String, String>> getTableContent() + public Collection<Map<String, Cell>> getTableContent() { - List<Map<String, String>> content = new ArrayList<Map<String, String>>(); + List<Map<String, Cell>> content = new ArrayList<Map<String, Cell>>(); List<WebElement> columnNames = arrange(getVisible(getColumns())); List<WebElement> gridValues = arrange(getVisible(getData())); int index = 0; - Map<String, String> map = new HashMap<String, String>(); + Map<String, Cell> map = new HashMap<String, Cell>(); for (WebElement element : gridValues) { String columnName = columnNames.get(index % columnNames.size()).getText(); - map.put(columnName, element.getText()); + + List<WebElement> a = new ArrayList<WebElement>(this.findElements(element, ".//A")); + if (a.size() > 0) + { + map.put(columnName, new Cell(element.getText(), a.get(0).getAttribute("href"))); + } else + { + map.put(columnName, new Cell(element.getText())); + } index++; if (index % columnNames.size() == 0) { content.add(map); - map = new HashMap<String, String>(); + map = new HashMap<String, Cell>(); } } return content; } + public Map<String, Cell> dataOf(Browsable browsable) + { + for (Map<String, Cell> row : getTableContent()) + { + if (browsable.isRepresentedBy(row)) + { + return row; + } + } + throw new IllegalStateException("Could not find " + browsable + " from " + toString()); + } + private List<WebElement> arrange(Collection<WebElement> elements) { List<WebElement> sorted = new ArrayList<WebElement>(elements); diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/Cell.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/Cell.java new file mode 100644 index 0000000000000000000000000000000000000000..067026d3b621daea569f9e638e45fd2a71a1efff --- /dev/null +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/Cell.java @@ -0,0 +1,71 @@ +/* + * 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; + +/** + * @author anttil + */ +public class Cell +{ + private final String text; + + private final String url; + + public Cell(String text) + { + this(text, null); + } + + public Cell(String text, String url) + { + this.text = text; + this.url = url; + } + + public String getText() + { + return text; + } + + public String getUrl() + { + return url; + } + + public boolean hasLink() + { + return this.url != null; + } + + @Override + public String toString() + { + return "Cell[text=" + text + ", url=" + url + "]"; + } + + @Override + public boolean equals(Object o) + { + if (!(o instanceof Cell)) + { + return false; + } + + Cell cell = (Cell) o; + return toString().equals(cell.toString()); + } +} 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 38aa9352c0dccc9740730e877551cd4d14d61c54..5cd5b005422cdf0f28d2d6cfe62d3bb28f77b143 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 @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; +import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -83,7 +84,10 @@ public abstract class Page public Collection<WebElement> findElements(WebElement element, String xpath) { + SeleniumTest.driver.manage().timeouts().implicitlyWait(0, TimeUnit.MILLISECONDS); Collection<WebElement> elements = element.findElements(By.xpath(xpath)); + SeleniumTest.driver.manage().timeouts().implicitlyWait(SeleniumTest.IMPLICIT_WAIT, + TimeUnit.MILLISECONDS); List<WebElement> wrapped = new ArrayList<WebElement>(); for (WebElement e : elements) { diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddVocabularyDialog.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddVocabularyDialog.java index a4f2ab7cde6803848c446599ed66717db846ed66..f541facf27486c5157480dcb2c87800e31e75059 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddVocabularyDialog.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/page/dialog/AddVocabularyDialog.java @@ -51,6 +51,7 @@ public class AddVocabularyDialog extends Page { this.terms.sendKeys(term + ", "); } + this.url.clear(); this.url.sendKeys(vocabulary.getUrl()); } 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 c99db8a7b64f3d73061a792e7056187252e0e51b..9afef8da26f994ca72d6208d6537175ef2e6c5b8 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 @@ -31,14 +31,14 @@ public class SampleBrowser extends BrowserPage @FindBys( { - @FindBy(id = "openbis_sample-type-browser-grid"), - @FindBy(xpath = "//*[contains(@class, \"x-grid\") and contains(@class, \"-header \")]") }) + @FindBy(id = "openbis_sample-browser_main-grid"), + @FindBy(xpath = ".//*[contains(@class, \"x-grid\") and contains(@class, \"-header \")]") }) private List<WebElement> columns; @FindBys( { - @FindBy(id = "openbis_sample-type-browser-grid"), - @FindBy(xpath = "//*[contains(@class, \"x-grid\") and contains(@class, \"-col \")]") }) + @FindBy(id = "openbis_sample-browser_main-grid"), + @FindBy(xpath = ".//*[contains(@class, \"x-grid\") and contains(@class, \"-col \")]") }) private List<WebElement> data; @FindBy(id = "openbis_sample-browser_main_add-button") diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Experiment.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Experiment.java index e16241275ed13400e3169cafbc3495fb38cbffd2..2c210ccbc0b71756df3eaf0a4ed4c9b178a9d897 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Experiment.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Experiment.java @@ -20,6 +20,7 @@ import java.util.Map; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; import ch.systemsx.cisd.openbis.uitest.infra.EntityType; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -40,9 +41,10 @@ public class Experiment implements EntityType, Browsable } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - return code.equalsIgnoreCase(row.get("Code")); + Cell codeCell = row.get("Code"); + return codeCell != null && codeCell.getText().equalsIgnoreCase(this.code); } @Override diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Project.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Project.java index 4115f6737ad44512ecf65897a282a232157c76f8..53d6be94459866b725844650fec11437a2010ac9 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Project.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Project.java @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.uitest.type; import java.util.Map; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -39,9 +40,10 @@ public class Project implements Browsable } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - return this.code.equalsIgnoreCase(row.get("Code")); + Cell codeCell = row.get("Code"); + return codeCell != null && codeCell.getText().equalsIgnoreCase(this.code); } public String getCode() 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 index 714b3ae27d74d8a4656e68911effebfa7c14f425..1b598d9d3efe3a00a91066b659f855e83a315fdf 100644 --- 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 @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.uitest.type; import java.util.Map; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -47,9 +48,10 @@ public class PropertyType implements Browsable } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - return this.code.equalsIgnoreCase(row.get("Code")); + Cell codeCell = row.get("Code"); + return codeCell != null && codeCell.getText().equalsIgnoreCase(this.code); } @Override diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeAssignment.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeAssignment.java index 558d237154f96641f0ed9275ab6604629d83198e..d955b48545bce4c6f52f7e9ada79e61ce7002114 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeAssignment.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/PropertyTypeAssignment.java @@ -20,6 +20,7 @@ import java.util.Map; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; import ch.systemsx.cisd.openbis.uitest.infra.EntityType; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -45,11 +46,15 @@ public class PropertyTypeAssignment implements Browsable } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - System.out.println("Searching from " + row); - return propertyType.getCode().equalsIgnoreCase(row.get("Property Type Code")) && - entityType.getCode().equalsIgnoreCase(row.get("Entity Type")); + Cell propertyTypeCode = row.get("Property Type Code"); + Cell entityTypeCode = row.get("Entity Type"); + + return propertyTypeCode != null && + entityTypeCode != null && + propertyTypeCode.getText().equalsIgnoreCase(propertyType.getCode()) && + entityTypeCode.getText().equalsIgnoreCase(entityType.getCode()); } @Override diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Sample.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Sample.java index 5ffab7cd54cfdd893a8a3b639828e1c6da9dda33..eed120698b973cbfdfa916293d36da408ec7449d 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Sample.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Sample.java @@ -21,6 +21,7 @@ import java.util.Map; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; import ch.systemsx.cisd.openbis.uitest.infra.EntityType; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -52,9 +53,16 @@ public class Sample implements EntityType, Browsable } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - return code.equalsIgnoreCase(row.get("Code")); + Cell codeCell = row.get("Code"); + return codeCell != null && codeCell.getText().equalsIgnoreCase(this.code); + } + + @Override + public String toString() + { + return "Sample " + this.code; } @Override 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 27d437da3a969ed0e9e7746bf958c759999413e0..39634922934253161044b6f229da4a50b0f8215c 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 @@ -21,6 +21,7 @@ import java.util.Map; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; import ch.systemsx.cisd.openbis.uitest.infra.EntityType; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -66,9 +67,10 @@ public class SampleType implements Browsable, EntityType } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - return this.code.equalsIgnoreCase(row.get("Code")); + Cell codeCell = row.get("Code"); + return codeCell != null && codeCell.getText().equalsIgnoreCase(this.code); } @Override diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Space.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Space.java index 7147b89d8f6d7f92032cbeb2edb04383203f549a..45b62eaaab72d57dbb6b0326ff336dec43612431 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Space.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Space.java @@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.uitest.type; import java.util.Map; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -36,9 +37,10 @@ public class Space implements Browsable } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - return this.code.equalsIgnoreCase(row.get("Code")); + Cell codeCell = row.get("Code"); + return codeCell != null && codeCell.getText().equalsIgnoreCase(this.code); } @Override diff --git a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Vocabulary.java b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Vocabulary.java index 86909cd8ad81e8ff416f13b3cbc82b62ef99f83a..761ce2cfcf288c1d897fc2eb8976d52761012db5 100644 --- a/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Vocabulary.java +++ b/ui-test/source/java/ch/systemsx/cisd/openbis/uitest/type/Vocabulary.java @@ -20,6 +20,7 @@ import java.util.Map; import java.util.Set; import ch.systemsx.cisd.openbis.uitest.infra.Browsable; +import ch.systemsx.cisd.openbis.uitest.page.Cell; /** * @author anttil @@ -43,9 +44,10 @@ public class Vocabulary implements Browsable } @Override - public boolean isRepresentedBy(Map<String, String> row) + public boolean isRepresentedBy(Map<String, Cell> row) { - return this.code.equalsIgnoreCase(row.get("Code")); + Cell codeCell = row.get("Code"); + return codeCell != null && codeCell.getText().equalsIgnoreCase(this.code); } @Override