Index: test/wrappers/qunit.js |
=================================================================== |
--- a/test/wrappers/qunit.js |
+++ b/test/wrappers/qunit.js |
@@ -23,19 +23,13 @@ |
it("qunit", function() |
{ |
return this.driver.navigate().to(this.origin + "/qunit/index.html").then(() => |
- // Wait for qunit-results to be present |
this.driver.wait(until.elementLocated(By.id("qunit-testresult"))) |
+ ).then(elem => |
Sebastian Noack
2018/09/24 18:56:05
.wait(until.elementLocated(...)) returns a promise
|
+ this.driver.wait(until.elementTextContains(elem, "Tests completed")) |
Sebastian Noack
2018/09/24 18:56:05
There is a pre-defined condition to wait for an el
|
).then(() => |
- // Wait for tests to finish |
- this.driver.wait(() => |
- this.driver.findElement(By.id("qunit-testresult")) |
- .getAttribute("innerHTML").then(data => |
- data.includes("Tests completed"))) |
- ).then(() => Promise.all([[true, ".pass"], [false, ".fail"]].map( |
- ([success, sel]) => this.driver.findElements( |
- By.css(`#qunit-tests ${sel} .test-name`) |
- ).then(elements => Promise.all(elements.map(elem => |
- elem.getAttribute("textContent").then(data => assert.ok(success, data)) |
- ))) |
- ))); |
+ this.driver.findElement(By.css("#qunit-tests .fail .test-name")).then( |
+ elem => elem.getAttribute("textContent").then(name => assert.fail(name)), |
Sebastian Noack
2018/09/24 18:56:05
Mocha only reports the first failure, it doesn't r
|
+ () => null |
+ ) |
+ ) |
}); |