本文整理汇总了Java中com.thoughtworks.selenium.SeleneseTestBase.assertTrue方法的典型用法代码示例。如果您正苦于以下问题:Java SeleneseTestBase.assertTrue方法的具体用法?Java SeleneseTestBase.assertTrue怎么用?Java SeleneseTestBase.assertTrue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thoughtworks.selenium.SeleneseTestBase
的用法示例。
在下文中一共展示了SeleneseTestBase.assertTrue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEditRouteRulesDelegation
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testEditRouteRulesDelegation() throws Exception {
waitForPageToLoad();
Thread.sleep(3000);
SeleneseTestBase.assertEquals("Kuali Portal Index", getTitle());
selectFrameIframePortlet();
waitAndClickSearch();
waitForPageToLoad();
Thread.sleep(3000);
waitAndClickEdit();
waitForPageToLoad();
Thread.sleep(3000);
SeleneseTestBase.assertTrue(isElementPresentByName(CANCEL_NAME));
waitAndClickCancel();
waitForPageToLoad();
Thread.sleep(3000);
waitAndClickByName("methodToCall.processAnswer.button0");
waitForPageToLoad();
passed();
}
示例2: 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));
}
示例3: testColumnSequence
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testColumnSequence() throws Exception {
waitAndClickByLinkText("Column Sequence");
Thread.sleep(3000);
waitAndTypeByName("newCollectionLines['list1'].field1", "1");
waitAndTypeByName("newCollectionLines['list1'].field2", "1");
waitAndTypeByName("newCollectionLines['list1'].field3", "1");
waitAndTypeByName("newCollectionLines['list1'].field4", "1");
waitAndClick(By.id("Collections-ColumnSequence-TableDefault_add"));
Thread.sleep(3000);
//Check if row has been added really or not
testIfRowHasBeenAdded();
//Check for the added if delete is present or not
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Collections-ColumnSequence-TableDefault_disclosureContent']/div[@class='dataTables_wrapper']/table/tbody/tr[2]/td[6]/div/fieldset/div/div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button"));
}
示例4: testSequencerow
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testSequencerow() throws Exception {
waitAndClickByLinkText("Save Row");
Thread.sleep(3000);
waitAndTypeByName("newCollectionLines['list1'].field1", "1");
waitAndTypeByName("newCollectionLines['list1'].field2", "1");
waitAndTypeByName("newCollectionLines['list1'].field3", "1");
waitAndTypeByName("newCollectionLines['list1'].field4", "1");
waitAndClickByXpath("//button[contains(.,'add')]");
Thread.sleep(3000);
//Check if row has been added really or not
testIfRowHasBeenAdded();
//Check for the added if delete is present or not
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Collections-SaveRow-Table_disclosureContent']/div[@class='dataTables_wrapper']/table/tbody/tr[2]/td[6]/div/fieldset/div/div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button"));
// SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Collections-SaveRow-Table_disclosureContent']/div[@class='dataTables_wrapper']/table/tbody/tr[2]/td[6]/div/fieldset/div/div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button[@class='uif-action uif-secondaryActionButton uif-smallActionButton uif-saveLineAction']"));
}
示例5: testAddLineWithSpecificTime
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void testAddLineWithSpecificTime(String idPrefix, String addLineIdSuffix) throws Exception {
waitForElementPresentByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']");
confirmAddLineControlsPresent(idPrefix, addLineIdSuffix);
String startTimeId = "//*[@id='" + idPrefix + "StartTime" + addLineIdSuffix + "']";
String inputTime = "7:06";
waitAndTypeByXpath(startTimeId, inputTime);
String amPmSelectLocator = "//*[@id='" + idPrefix + "StartTimeAmPm" + addLineIdSuffix + "']";
selectByXpath(amPmSelectLocator, "PM");
SeleneseTestBase.assertEquals("PM", getAttributeByXpath(amPmSelectLocator, "value"));
Thread.sleep(5000); //allow for ajax refresh
waitAndClickByXpath("//button");
Thread.sleep(5000); //allow for line to be added
//confirm that line has been added
SeleneseTestBase.assertTrue("line (//input[@value='7:06'])is not present https://jira.kuali.org/browse/KULRICE-8162 Configuration Test View Time Info add line button doesn't addline",
isElementPresentByXpath("//input[@value='7:06']"));
}
示例6: 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);
}
示例7: 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;
}
示例8: verifyRichMessagesValidationAdvancedFunctionality
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void verifyRichMessagesValidationAdvancedFunctionality() throws Exception
{
//Color Options
SeleneseTestBase.assertTrue(isElementPresentByXpath("//span[@style='color: green;']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//span[@style='color: blue;']"));
//Css class
SeleneseTestBase.assertTrue(isElementPresentByXpath("//span[@class='fl-text-underline fl-text-larger']"));
//Combinations
SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field3']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//select[@name='field4']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//button[contains(text(), 'Action Button')]"));
//Rich Message Field
SeleneseTestBase.assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/span[contains(., 'Color')]"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/i/b[contains(., 'Html')]"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/img[@class='uif-image inlineBlock']"));
Thread.sleep(3000);
}
示例9: verifyRichMessagesValidationRadioAndCheckBoxGroupFunctionality
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void verifyRichMessagesValidationRadioAndCheckBoxGroupFunctionality() throws Exception
{
//Radio Group
SeleneseTestBase.assertTrue(isElementPresentByXpath("//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='1']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='2']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='3']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='4']"));
//Checkbox Group
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='1']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='2']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='3']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//fieldset[@class='uif-verticalCheckboxesFieldset']/span/label/div/select[@name='field4']"));
//Checkbox Control
SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='checkbox' and @name='bField1']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field103']"));
}
示例10: verifyRichMessagesValidationLinkDeclarationsFunctionality
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void verifyRichMessagesValidationLinkDeclarationsFunctionality() throws Exception
{
//Testing link tag
waitAndClickByXpath("//div[contains(., 'Testing link tag')]/a");
Thread.sleep(9000);
switchToWindow("Open Source Software | www.kuali.org");
switchToWindow(RICH_MESSAGES_WINDOW_TITLE);
//Testing methodToCall Action
waitAndClickByXpath("//div[contains(., 'Testing methodToCall action')]/a");
Thread.sleep(3000);
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages uif-pageValidationMessages-error']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath(
"//div[@id='Demo-AdvancedMessagesSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Demo-RadioCheckboxMessageSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
//Testing methodToCall action (no client validation check)
waitAndClickByXpath("//div[contains(., 'Testing methodToCall action (no client validation check)')]/a");
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages uif-pageValidationMessages-error']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-validationMessages uif-groupValidationMessages']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages uif-pageValidationMessages-error']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Demo-AdvancedMessagesSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Demo-RadioCheckboxMessageSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
Thread.sleep(3000);
}
示例11: 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);
}
示例12: assertTableLayout
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
protected void assertTableLayout() {
String pageSource = driver.getPageSource();
SeleneseTestBase.assertTrue(pageSource.contains("Table Layout"));
SeleneseTestBase.assertTrue(pageSource.contains("Field 1"));
SeleneseTestBase.assertTrue(pageSource.contains("Field 2"));
SeleneseTestBase.assertTrue(pageSource.contains("Field 3"));
SeleneseTestBase.assertTrue(pageSource.contains("Field 4"));
SeleneseTestBase.assertTrue(pageSource.contains("Actions"));
}
示例13: 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();
}
示例14: 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"));
}
示例15: confirmAddLineControlsPresent
import com.thoughtworks.selenium.SeleneseTestBase; //导入方法依赖的package包/类
/**
* verify that add line controls are present
*/
protected void confirmAddLineControlsPresent(String idPrefix, String addLineIdSuffix) {
String[] addLineIds = {"StartTime", "StartTimeAmPm", "AllDay"};
for (String id : addLineIds) {
String tagId = "//*[@id='" + idPrefix + id + addLineIdSuffix + "']";
SeleneseTestBase.assertTrue("Did not find id " + tagId, isElementPresentByXpath(tagId));
}
}