Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/wrappers/qunit.js

Issue 29890620: Noissue - Simplified qunit test wrapper (Closed)
Patch Set: Added missing semicolon Created Sept. 24, 2018, 7:09 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =>
+ this.driver.wait(until.elementTextContains(elem, "Tests completed"))
).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)),
+ () => null
+ )
+ );
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld