Package org.zanata.util

Examples of org.zanata.util.TableRow


                .sendKeys(personName);

        log.info("Click search button");
        waitForWebElement(addUserSearchButton).click();

        TableRow firstRow = tryGetFirstRowInSearchPersonResult(personName);

        final String personUsername = firstRow.getCellContents()
                .get(SEARCH_RESULT_PERSON_COLUMN);
        log.info("Username to be added: {}", personUsername);
        log.info("Set checked as translator");
        Checkbox.of(firstRow.getCells()
                .get(ISTRANSLATOR_COLUMN)
                .findElement(By.tagName("input")))
                .check();
        log.info("Click Add Selected");
        waitForWebElement(addSelectedButton).click();
View Full Code Here


    }

    public ManageLanguageTeamMemberPage manageTeamMembersFor(
            final String localeId) {
        log.info("Click team {}", localeId);
        TableRow matchedRow = findRowByLocale(localeId);

        log.debug("for locale [{}] found table row: {}", localeId, matchedRow);
        List<WebElement> cells = matchedRow.getCells();
        int teamMemberCellIndex = cells.size() - 1;
        WebElement teamMemberCell = cells.get(teamMemberCellIndex);
        WebElement teamMemberButton =
                teamMemberCell.findElement(By
                        .xpath(".//input[@value='Team Members']"));
View Full Code Here

        teamMemberButton.click();
        return new ManageLanguageTeamMemberPage(getDriver());
    }

    private TableRow findRowByLocale(final String localeId) {
        TableRow matchedRow =
                waitForAMoment().until(new Function<WebDriver, TableRow>() {
                    @Override
                    public TableRow apply(WebDriver driver) {
                        List<TableRow> tableRows =
                                WebElementUtil.getTableRows(getDriver(),
                                        languageTable);
                        Optional<TableRow> matchedRow =
                                Iterables.tryFind(tableRows,
                                        new Predicate<TableRow>() {
                                            @Override
                                            public boolean
                                                    apply(TableRow input) {
                                                List<String> cellContents =
                                                        input.getCellContents();
                                                String localeCell =
                                                        cellContents.get(
                                                                LOCALE_COLUMN)
                                                                .trim();
                                                return localeCell
                                                        .equalsIgnoreCase(localeId);
                                            }
                                        });

                        // we keep looking for the locale until timeout
                        return matchedRow.isPresent() ? matchedRow.get() : null;
                    }
                });
        return matchedRow;
    }
View Full Code Here

        return matchedRow;
    }

    public ManageLanguagePage enableLanguageByDefault(String localeId) {
        log.info("Click to enable {}", localeId);
        TableRow matchedRow = findRowByLocale(localeId);

        WebElement enabledCell = matchedRow.getCells().get(ENABLED_COLUMN);
        WebElement enabledCheckbox =
                enabledCell.findElement(By.tagName("input"));
        if (!enabledCheckbox.isSelected()) {
            enabledCheckbox.click();
            getDriver().switchTo().alert().accept();
View Full Code Here

TOP

Related Classes of org.zanata.util.TableRow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.