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


Java SeleneseTestBase.assertFalse方法代码示例

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


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

示例1: testDisplayOnlyTooltipHelp

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
/**
 * Test the tooltip help on the sub-section and fields that are display only
 */
 protected void testDisplayOnlyTooltipHelp() throws Exception {
    // verify that no tooltips are displayed initially
    if (isElementPresentByXpath("//td[contains(text(),'Sample text for sub-section help')]")) {
        SeleneseTestBase.assertFalse(isVisible("//td[contains(text(),'Sample text for sub-section help')]"));
    }
    
    if (isElementPresentByXpath("//td[contains(text(),'Sample text for read only field help')]")) {
        SeleneseTestBase.assertFalse(isVisible("//td[contains(text(),'Sample text for read only field help')]"));
    }

    // test tooltip help of sub-section header
    fireMouseOverEventByXpath("//span[contains(text(),'Display only fields')]");
    SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for sub-section help')]"));
    String javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" +
            "element[0].style.display='none'"; 
    ((JavascriptExecutor) driver).executeScript(javascript);
    SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for sub-section help')]"));

    // test tooltip help of display only data field
    fireMouseOverEventByXpath("//label[@for='display-field_control']");
    SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for read only field help')]"));
    javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" +
            "element[0].style.display='none'"; 
    ((JavascriptExecutor) driver).executeScript(javascript);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:WebDriverLegacyITBase.java

示例2: testMissingTooltipHelp

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
/**
 * Test the tooltip help on the section and fields with no content
 */
protected void testMissingTooltipHelp() throws Exception {
    // verify that no tooltips are displayed initially
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));

    // verify that no external help exist
    SeleneseTestBase.assertFalse(isElementPresent("#ConfigurationTestView-Help-Section2 input.uif-helpImage"));
   
    // test tooltip help of section header
    fireMouseOverEventByXpath("//div[@id='ConfigurationTestView-Help-Section2']/div");
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));

    // test tooltip help of field
    fireMouseOverEventByXpath("//label[@id='missing-tooltip-help_label']");
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:21,代码来源:WebDriverLegacyITBase.java

示例3: testMissingExternalHelp2

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
/**
 * Test the external help on the section and fields with missing help URL
 */

protected void testMissingExternalHelp2() throws Exception {
    // test external help of section is not rendered
    SeleneseTestBase.assertFalse(isElementPresent(By.cssSelector("input[title=\"Help for Missing External Help\"]")));

    // test external help of field with blank externalHelpURL is not rendered
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='external-help-externalHelpUrl-empty']/*[@class='uif-helpImage']"));

    // test external help of field with empty helpDefinition is not rendered
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='external-help-helpdefinition-empty']/*[@class='uif-helpImage']"));

    // test external help of field with missing system parameter is not rendered
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='external-help-system-parm-missing']/*[@class='uif-helpImage']"));

    // test external help of standalone help widget is not rendered
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='standalone-external-help-missing']"));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:21,代码来源:WebDriverLegacyITBase.java

示例4: validateErrorImage

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected boolean validateErrorImage(boolean validateVisible) throws Exception {
    Thread.sleep(500);
    boolean valid = false;

    for (int second = 0; second < 5; second++) {
        if ((valid = validateErrorImage(validateVisible, second, ARIA_INVALID_XPATH)) == true) {
            break;
        }
    }

    if (validateVisible) {
        SeleneseTestBase.assertTrue("valid = " + valid + " when validateVisible is " + validateVisible, valid);
    } else {
        SeleneseTestBase.assertFalse("valid = " + valid + " when validateVisible is " + validateVisible, valid);
    }

    return valid;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:19,代码来源:WebDriverLegacyITBase.java

示例5: testBreadcrumb

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testBreadcrumb(int pageNumber) throws Exception {
    // <ul id="u13_control" class="uif-optionList" data-control_for="u13" tabindex="0"><li class="uif-optionList-item uif-optionList-selectedItem"><a href="http://env1.rice.kuali.org/kr-krad/uicomponents?methodToCall=start&pageId=UifCompView-Page1&viewId=UifCompView" data-key="UifCompView-Page1">
    //         Input Fields and Controls
    // </a></li>
    // <li class="uif-optionList-item"><a href="http://env1.rice.kuali.org/kr-krad/uicomponents?methodToCall=start&pageId=UifCompView-Page2&viewId=UifCompView" data-key="UifCompView-Page2">
    //         Other Fields
    // </a></li>
    // etc.
    SeleneseTestBase.assertFalse(isVisibleByXpath(SECOND_BREADCRUMB_NAV_XPATH));
    // The second ▼
    waitAndClickByXpath(SECOND_DOWN_TRIANGLE_XPATH);
    SeleneseTestBase.assertTrue(isVisibleByXpath(SECOND_BREADCRUMB_NAV_XPATH));
    waitAndClickByXpath(SECOND_DOWN_TRIANGLE_XPATH);
    SeleneseTestBase.assertFalse(isVisibleByXpath(SECOND_BREADCRUMB_NAV_XPATH));
    waitAndClickByXpath(SECOND_DOWN_TRIANGLE_XPATH);

    // The Second selection of the second ▼
    // you can't just click by link text as the same clickable text is on the left navigation.
    waitAndClickByXpath(SECOND_BREADCRUMB_NAV_XPATH +"/li[" + pageNumber + "]/a");
    waitForElementPresentById("TopLink" + pageNumber); // bottom jump to top link
    driver.getCurrentUrl().contains("pageId=UifCompView-Page" + pageNumber);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:23,代码来源:BreadcrumbSmokeTestBase.java

示例6: testBreadcrumbNavigateToSetup

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testBreadcrumbNavigateToSetup() throws InterruptedException {
    selectTopFrame();

    // div id="Uif-BreadcrumbWrapper" class="uif-sticky" data-sticky="true" style="position:fixed; left: 0; top: 39.55000305175781px;">
    waitForElementPresentById("Uif-BreadcrumbWrapper");

    // <span data-role="breadcrumb" id="u12">Input Fields and Controls</span>
    waitForElementPresentById("u12");
    SeleneseTestBase.assertEquals("Input Fields and Controls", getTextById("u12"));

    // <label id="u6610_label" for="u6610_control" data-label_for="u6610">
    //        Navigate to:
    // </label>
    SeleneseTestBase.assertFalse(isVisibleByXpath(NAVIGATE_TO_LABEL_XPATH));
    // the first ▼
    waitAndClickByLinkText("▼");
    SeleneseTestBase.assertTrue(isVisibleByXpath(NAVIGATE_TO_LABEL_XPATH));
    SeleneseTestBase.assertEquals("Navigate to:",getTextByXpath(NAVIGATE_TO_LABEL_XPATH));
    // the first ▼
    waitAndClickByLinkText("▼");
    SeleneseTestBase.assertFalse(isVisibleByXpath(NAVIGATE_TO_LABEL_XPATH));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:23,代码来源:BreadcrumbSmokeTestBase.java

示例7: testUifTooltip

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testUifTooltip(String NAME_FIELD_1, String NAME_FIELD_2) throws Exception {
    // check if tooltip opens on focus
    fireEvent(NAME_FIELD_1, "focus");
    fireMouseOverEventByName(NAME_FIELD_1);
    
    // SeleneseTestBase.assertTrue(isVisible("div.jquerybubblepopup.jquerybubblepopup-black") && isVisible("td.jquerybubblepopup-innerHtml"));
    SeleneseTestBase.assertEquals("This tooltip is triggered by focus or and mouse over.", getText(
            "td.jquerybubblepopup-innerHtml"));

    // check if tooltip closed on blur
    fireEvent(NAME_FIELD_1, "blur");
    SeleneseTestBase.assertFalse(isVisible("div.jquerybubblepopup.jquerybubblepopup-black") && isVisible(
            "td.jquerybubblepopup-innerHtml"));
    Thread.sleep(5000);
    fireEvent("field119", "focus");
    
    // check if tooltip opens on mouse over
    fireMouseOverEventByName(NAME_FIELD_2);        
    SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(.,\"This is a tool-tip with different position and tail options\")]"));

    // check if tooltip closed on mouse out
    waitAndTypeByName(NAME_FIELD_2, "a");
    Thread.sleep(5000);
    SeleneseTestBase.assertFalse(isVisibleByXpath(
            "//td[contains(.,\"This is a tool-tip with different position and tail options\")]"));

    // check that default tooltip does not display when there are an error message on the field
    waitAndTypeByName(NAME_FIELD_1, "1");
    fireEvent(NAME_FIELD_1, "blur");
    fireMouseOverEventByName(NAME_FIELD_1);
    Thread.sleep(10000);
    SeleneseTestBase.assertTrue("https://jira.kuali.org/browse/KULRICE-8141 Investigate why UifTooltipIT.testTooltip fails around jquerybubblepopup",
                    isVisibleByXpath("//div[@class='jquerybubblepopup jquerybubblepopup-kr-error-cs']") &&
                            !(isVisibleByXpath("//div[@class='jquerybubblepopup jquerybubblepopup-black']")));
   
    // TODO figure out this last assert     
    passed();
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:39,代码来源:WebDriverLegacyITBase.java

示例8: testConfigurationTestView

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testConfigurationTestView(String idPrefix) throws Exception {
    waitForElementPresentByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']");
    
    // testing for https://groups.google.com/a/kuali.org/group/rice.usergroup.krad/browse_thread/thread/1e501d07c1141aad#
    String styleValue = getAttributeByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']", "style");
    
    // log.info("styleValue is " + styleValue);
    SeleneseTestBase.assertTrue(idPrefix + "textInputField label does not contain expected style", styleValue.replace(" ", "").contains("color:red"));
    
    // get current list of options
    String refreshTextSelectLocator = "//select[@id='" + idPrefix + "RefreshTextField_control']";
    String[] options1 = getSelectOptionsByXpath(refreshTextSelectLocator);
    String dropDownSelectLocator = "//select[@id='" + idPrefix + "DropDown_control']";
    selectByXpath(dropDownSelectLocator, "Vegetables");
    Thread.sleep(3000);
    
    //get list of options after change
    String[] options2 = getSelectOptionsByXpath(refreshTextSelectLocator);
    
    //verify that the change has occurred
    SeleneseTestBase.assertFalse(
            "Field 1 selection did not change Field 2 options https://jira.kuali.org/browse/KULRICE-8163 Configuration Test View Conditional Options doesn't change Field 2 options based on Field 1 selection",
            options1[options1.length - 1].equalsIgnoreCase(options2[options2.length - 1]));
    
    //confirm that control gets disabled
    selectByXpath(dropDownSelectLocator, "None");
    Thread.sleep(3000);
    SeleneseTestBase.assertEquals("true", getAttributeByXpath(refreshTextSelectLocator, "disabled"));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:30,代码来源: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: testViewHelp2

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
/**
 * Test the tooltip and external help on the view
 */
protected void testViewHelp2() throws Exception {
    // test tooltip help
    if (isElementPresentByXpath("//td[@class='jquerybubblepopup-innerHtml']")) {
        SeleneseTestBase.assertFalse(driver.findElement(By.cssSelector("td.jquerybubblepopup-innerHtml")).isDisplayed());
    }

    // test tooltip help
    fireMouseOverEventByXpath("//h1/span[@class='uif-headerText-span']");
    Thread.sleep(2000);
    SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'View help')]"));
    assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for Configuration Test View\"]"), "HelpWindow", "http://www.kuali.org/");
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:16,代码来源:WebDriverLegacyITBase.java

示例11: verifyRichMessagesValidationLettersNumbersValidation

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void verifyRichMessagesValidationLettersNumbersValidation() throws Exception
{
    //For letters only Validation
    SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field5']"));
    waitAndTypeByXpath(
            "//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock']/input[@name= 'field5']",
            "abc");
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
    clearTextByXpath(
            "//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock']/input[@name= 'field5']");
    waitAndTypeByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock']/input[@name= 'field5']","abc12");
    waitAndTypeByXpath("//input[@name= 'field6']", "");
    SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
    Thread.sleep(3000);
    clearTextByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']/input[@name= 'field5']");
    waitAndTypeByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']/input[@name= 'field5']","abc");
    waitAndTypeByXpath("//input[@name= 'field6']", "");

    //For numbers only validation
    waitAndTypeByXpath("//input[@name= 'field6']", "123");
    SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
    clearTextByXpath("//input[@name= 'field6']");
    waitAndTypeByXpath("//input[@name= 'field6']", "123ab");
    fireEvent("field6", "blur");
    Thread.sleep(5000);
    SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
    Thread.sleep(3000);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:WebDriverLegacyITBase.java

示例12: assertAttributeClassRegexDoesntMatch

import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void assertAttributeClassRegexDoesntMatch(String field, String regex) throws InterruptedException {
    String attribute = getAttributeByName(field, "class");
    SeleneseTestBase.assertTrue("getAttributeByName(" + field + ", \"class\") should not be null", attribute != null);
    SeleneseTestBase.assertFalse("attribute " + attribute + " matches regex " + regex + " and it should not",
            attribute.matches(regex));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:7,代码来源:WebDriverLegacyITBase.java


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