本文整理汇总了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");
}
}
示例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
}
}
示例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);
}
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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"));
}
示例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"));
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}