当前位置: 首页>>代码示例>>Java>>正文


Java SeleneseTestBase.fail方法代码示例

本文整理汇总了Java中com.thoughtworks.selenium.SeleneseTestBase.fail方法的典型用法代码示例。如果您正苦于以下问题:Java SeleneseTestBase.fail方法的具体用法?Java SeleneseTestBase.fail怎么用?Java SeleneseTestBase.fail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.thoughtworks.selenium.SeleneseTestBase的用法示例。


在下文中一共展示了SeleneseTestBase.fail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAgendaEditRuleRefreshIT

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testAgendaEditRuleRefreshIT() throws Exception {
    selectFrameIframePortlet();
    waitAndClickByXpath("//div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button[1]"); //  jiraAwareWaitAndClick("id=32");
    Thread.sleep(3000);
    waitAndClickByXpath("//a[@title='edit Agenda Definition with Agenda Id=T1000']",
            "Does user have edit permissions?"); // jiraAwareWaitAndClick("id=194_line0");
    checkForIncidentReport("");
    Thread.sleep(3000);
    waitAndClickByXpath("//li/a[@class='agendaNode ruleNode']"); // jiraAwareWaitAndClick("//li[@id='473_node_0_parent_root']/a");
    waitAndClickByXpath("//li/a[@class='agendaNode logicNode whenTrueNode']");
    waitAndClickByLinkText("[-] collapse all");

    // click refresh  several times
    for (int i = 0; i < 6; i++) {
        for (int second = 0;; second++) {
            if (second >= waitSeconds)
                SeleneseTestBase.fail(TIMEOUT_MESSAGE);
            try {
                if (isElementPresent(".kr-refresh-button"))
                    break;
            } catch (Exception e) {}
            Thread.sleep(1000);
        }
        waitAndClick("button.kr-refresh-button");
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:27,代码来源:WebDriverLegacyITBase.java

示例2: jGrowlException

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
/**
 * <p>
 * Print jGrowl Exception to System.out, if {@see #JGROWL_ERROR_FAILURE} is set to true, fail.
 * </p>
 *
 * @param throwable message and stack trace to print and if configured fail with
 */
public static void jGrowlException(Throwable throwable, String jGrowlJavascript) {
    String failMessage = jGrowlJavascript + " failed with " + throwable.getMessage() + "\n"
            + ExceptionUtils.getStackTrace(throwable);
    System.out.println("jGrowl failure " + failMessage);
    if (JGROWL_ERROR_FAILURE) {
        SeleneseTestBase.fail(failMessage); // SeleneseTestBase fail okay here as jGrowl failures are not Jira worthy yet
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:WebDriverUtils.java

示例3: jGrowlException

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
public static void jGrowlException(Throwable t) {
    String failMessage = t.getMessage() + "\n" + ExceptionUtils.getStackTrace(t);
    System.out.println("jGrowl failure " + failMessage);
    if (JGROWL_ERROR_FAILURE) {
        SeleneseTestBase.fail(failMessage);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:8,代码来源:WebDriverUtil.java

示例4: processIncidentReport

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
private static void processIncidentReport(String contents, String linkLocator, Failable failable, String message) {
    failOnMatchedJira(contents, failable);

    if (contents.indexOf("Incident Feedback") > -1) {
        failWithReportInfo(contents, linkLocator, message);
    }

    if (contents.indexOf("Incident Report") > -1) { // KIM incident report
        failWithReportInfoForKim(contents, linkLocator, message);
    }

    SeleneseTestBase.fail("\nIncident report detected " + message + "\n Unable to parse out details for the contents that triggered exception: " + deLinespace(
            contents));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:15,代码来源:WebDriverUtil.java

示例5: assertElementPresentByName

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void assertElementPresentByName(String name, String message) {
    try {
        driver.findElement(By.name(name));
    } catch (Exception e) {
        SeleneseTestBase.fail(name + " not present " + message);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:8,代码来源:WebDriverLegacyITBase.java

示例6: checkErrorMessageItem

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void checkErrorMessageItem(String message) {
    final String error_locator = "//li[@class='uif-errorMessageItem']";
    assertElementPresentByXpath(error_locator);
    String errorText = null;

    try {
        errorText = getTextByXpath(error_locator);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }

    if (errorText != null && errorText.contains("errors")) {
        SeleneseTestBase.fail(errorText + message);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:16,代码来源:WebDriverLegacyITBase.java

示例7: checkForDocError

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
public void checkForDocError() {
    if (hasDocError()) {
        String errorText = driver.findElement(By.xpath(ITUtil.DIV_ERROR_LOCATOR)).getText();
        errorText = ITUtil.blanketApprovalCleanUpErrorText(errorText);
        if (driver.findElements(By.xpath(ITUtil.DIV_EXCOL_LOCATOR)).size() > 0) { // not present if errors are at the bottom of the page (see left-errmsg below)
            errorText = ITUtil.blanketApprovalCleanUpErrorText(driver.findElement(
                    By.xpath(ITUtil.DIV_EXCOL_LOCATOR)).getText()); // replacing errorText as DIV_EXCOL_LOCATOR includes the error count
        }
        if (driver.findElements(By.xpath(DIV_LEFT_ERRMSG)).size() > 0) {
            errorText = errorText + ITUtil.blanketApprovalCleanUpErrorText(driver.findElement(By.xpath(DIV_LEFT_ERRMSG)).getText());
        }
        SeleneseTestBase.fail(errorText);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:15,代码来源:WebDriverLegacyITBase.java

示例8: testDefaultTestsTableLayout

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testDefaultTestsTableLayout() throws Exception {
    assertTableLayout();
    waitAndTypeByName("newCollectionLines['list1'].field1", "asdf1");
    waitAndTypeByName("newCollectionLines['list1'].field2", "asdf2");
    waitAndTypeByName("newCollectionLines['list1'].field3", "asdf3");
    waitAndTypeByName("newCollectionLines['list1'].field4", "asdf4");
    waitAndClickByXpath("//button[contains(.,'add')]"); // the first button is the one we want

    for (int second = 0;; second++) {            
        if (second >= waitSeconds)
            SeleneseTestBase.fail(TIMEOUT_MESSAGE);
        try {               
            if (getAttributeByName("newCollectionLines['list1'].field1", "value").equals(""))
                break;
        } catch (Exception e) {}
        Thread.sleep(1000);
    }

    SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field1", "value"));
    SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field2", "value"));
    SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field3", "value"));
    SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field4", "value"));
    SeleneseTestBase.assertEquals("asdf1", getAttributeByName("list1[0].field1", "value"));
    SeleneseTestBase.assertEquals("asdf2", getAttributeByName("list1[0].field2", "value"));
    SeleneseTestBase.assertEquals("asdf3", getAttributeByName("list1[0].field3", "value"));
    SeleneseTestBase.assertEquals("asdf4", getAttributeByName("list1[0].field4", "value"));
    SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Collections-Base-TableLayout_disclosureContent']/div/table/tbody/tr[2]/td[6]/div/fieldset/div/div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button"));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:WebDriverLegacyITBase.java

示例9: testServerErrorsIT

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testServerErrorsIT() throws Exception {
    waitAndClickByXpath("//button[contains(.,'Get Error Messages')]");
    waitForPageToLoad();
    Thread.sleep(5000);
    assertElementPresent("div[data-messagesfor=\"Demo-ValidationLayout-SectionsPage\"] .uif-errorMessageItem");
    waitIsVisibleByXpath("//div[@data-header_for='Demo-ValidationLayout-Section1']");
    assertElementPresentByXpath("//*[@data-messageitemfor='Demo-ValidationLayout-Section1' and @class='uif-errorMessageItem']");
    assertElementPresent("div[data-role=\"InputField\"] img[alt=\"Error\"]");
    assertElementPresentByXpath("//a[contains(.,'Section 1 Title')]");
    fireMouseOverEventByXpath("//a[contains(.,'Field 1')]");
    assertElementPresent(".uif-errorMessageItem-field");
    waitAndClickByXpath("//a[contains(.,'Field 1')]");
    Thread.sleep(2000);
    waitIsVisible(".jquerybubblepopup-innerHtml");
    waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems");
    waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
    waitAndTypeByName("field1", "");
    fireEvent("field1", "blur");
    fireEvent("field1", "focus");
    waitIsVisible(".jquerybubblepopup-innerHtml");
    waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
    waitIsVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems");
    waitIsVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems  .uif-errorMessageItem-field");
    waitAndTypeByName("field1", "t");

    for (int second = 0;; second++) {
        if (second >= waitSeconds) {
            SeleneseTestBase.fail(TIMEOUT_MESSAGE);
        }
        try {
            if (!isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems")) {
                break;
            }
        } catch (Exception e) {}
        Thread.sleep(1000);
    }

    waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
    SeleneseTestBase.assertFalse(isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:41,代码来源:WebDriverLegacyITBase.java

示例10: waitIsVisible

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void waitIsVisible(By by) throws InterruptedException {
    for (int second = 0;; second++) {
        if (second >= waitSeconds) {
            SeleneseTestBase.fail(TIMEOUT_MESSAGE + " " + by.toString());
        }
        if (isVisible(by)) {
            break;
        }
        Thread.sleep(1000);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:12,代码来源:WebDriverLegacyITBase.java

示例11: waitNotVisible

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void waitNotVisible(By by) throws InterruptedException {
    for (int second = 0;; second++) {
        if (second >= waitSeconds) {
            SeleneseTestBase.fail(TIMEOUT_MESSAGE);
        }
        if (!isVisible(by)) {
            break;
        }
        Thread.sleep(1000);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:12,代码来源:WebDriverLegacyITBase.java

示例12: fail

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
public void fail(String message) { // should this method be abstract or overridden, no jira aware fail?
    SeleneseTestBase.fail(message);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:WebDriverITBase.java

示例13: failWithReportInfoForKim

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
private static void failWithReportInfoForKim(String contents, String linkLocator, String message) {
    final String kimIncidentReport = extractIncidentReportKim(contents, linkLocator, message);
    SeleneseTestBase.fail(kimIncidentReport);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:5,代码来源:WebDriverUtil.java

示例14: failWithReportInfo

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
private static void failWithReportInfo(String contents, String linkLocator, String message) {
    final String incidentReportInformation = extractIncidentReportInfo(contents, linkLocator, message);
    SeleneseTestBase.fail(incidentReportInformation);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:5,代码来源:WebDriverUtil.java

示例15: assertTextPresent

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void assertTextPresent(String text, String message) {
    if (!driver.getPageSource().contains(text)) {
        SeleneseTestBase.fail(text + " not present " + message);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:6,代码来源:WebDriverLegacyITBase.java


注:本文中的com.thoughtworks.selenium.SeleneseTestBase.fail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。