Skip to content

Commit e793a79

Browse files
committed
improved test output
1 parent aa1b030 commit e793a79

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/test/java/org/htmlunit/libraries/JQueryTestBase.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,19 @@ protected void runTest(final String testName) throws Exception {
118118

119119
final String result = getResultDetailElementText(webDriver, testNumber);
120120
final String expected = testName + " (" + getExpectedAlerts()[0] + ")";
121-
if (!expected.contains(result)) {
121+
if (expected.contains(result)) {
122122
System.out.println("--------------------------------------------");
123-
System.out.println("URL: " + url);
124-
System.out.println("--------------------------------------------");
125-
System.out.println("Test: " + webDriver.findElement(By.id("qunit-tests")).getText());
126-
System.out.println("--------------------------------------------");
127-
System.out.println("Failures:");
123+
System.out.println("URL: " + url);
124+
System.out.println("Test: " + webDriver.findElement(By.id("qunit-tests")).getText());
125+
System.out.println("Result: " + result);
126+
System.out.println("Failures: ");
128127
final List<WebElement> failures = webDriver.findElements(By.cssSelector(".qunit-assert-list li.fail"));
129128
for (final WebElement webElement : failures) {
130129
System.out.println(" " + webElement.getText());
131130
}
132131
System.out.println("--------------------------------------------");
133132

134-
Assertions.fail("ToDo" /* new ComparisonFailure("", expected, result).getMessage()*/);
133+
Assertions.fail("'" + expected + "' does not contain '" + result);
135134
}
136135
}
137136
catch (final Exception e) {

0 commit comments

Comments
 (0)