test sutie clean up, including moving iframe tests to their own file

This commit is contained in:
Peter Snyder 2017-10-25 23:02:06 -05:00
parent f27ef5d4f9
commit ec84e283a1
3 changed files with 24 additions and 12 deletions

View file

@ -4,21 +4,25 @@ const utils = require("./lib/utils");
const injected = require("./lib/injected"); const injected = require("./lib/injected");
const testServer = require("./lib/server"); const testServer = require("./lib/server");
describe("Basic", function () { describe("Basic Functionality", function () {
const svgTestScript = injected.testSVGTestScript(); const svgTestScript = injected.testSVGTestScript();
let httpServer; let httpServer;
let testUrl; let testUrl;
this.timeout = function () {
return 10000;
};
describe("blocking", function () { describe("blocking", function () {
this.timeout = function () {
return 20000;
};
it("SVG Not Blocking", function (done) { it("SVG Not Blocking", function (done) {
this.timeout = function () {
return 10000;
};
const [server, url] = testServer.start(); const [server, url] = testServer.start();
testUrl = url; testUrl = url;
@ -50,6 +54,10 @@ describe("Basic", function () {
it("SVG blocking", function (done) { it("SVG blocking", function (done) {
this.timeout = function () {
return 10000;
};
const [server, url] = testServer.start(); const [server, url] = testServer.start();
testUrl = url; testUrl = url;
@ -77,8 +85,12 @@ describe("Basic", function () {
}); });
}); });
it("iFrame contentWindow without src", function (done) { it("iframe contentWindow without src", function (done) {
this.timeout = function () {
return 10000;
};
const testHtml = `<!DOCTYPE "html"> const testHtml = `<!DOCTYPE "html">
<html> <html>
<head> <head>
@ -89,7 +101,7 @@ describe("Basic", function () {
</body> </body>
</html>`; </html>`;
const iframeContentWindowScript = 'document.getElementsByTagName("iframe")[0].contentWindow.SVGGraphicsElement.prototype.getBBox().bartSimpson'; const iframeContentWindowScript = "document.getElementsByTagName('iframe')[0].contentWindow.SVGGraphicsElement.prototype.getBBox()";
const [server, url] = testServer.start(undefined, testHtml); const [server, url] = testServer.start(undefined, testHtml);
@ -105,8 +117,8 @@ describe("Basic", function () {
return utils.promiseSetBlockingRules(driver, standardsToBlock); return utils.promiseSetBlockingRules(driver, standardsToBlock);
}) })
.then(() => driverReference.get(testUrl)) .then(() => driverReference.get(testUrl))
.then(() => driverReference.executeAsyncScript(iframeContentWindowScript)) .then(() => driverReference.executeScript(iframeContentWindowScript))
.then(function (output) { .then(function () {
driverReference.quit(); driverReference.quit();
testServer.stop(httpServer); testServer.stop(httpServer);
done(); done();
@ -116,6 +128,7 @@ describe("Basic", function () {
testServer.stop(httpServer); testServer.stop(httpServer);
done(e); done(e);
}); });
}) });
}); });
}); });

View file

@ -4,7 +4,7 @@ const utils = require("./lib/utils");
const injected = require("./lib/injected"); const injected = require("./lib/injected");
const testServer = require("./lib/server"); const testServer = require("./lib/server");
describe("Content-Security-Protocol tests", function () { describe("Content-Security-Protocol Issues", function () {
describe("script-src", function () { describe("script-src", function () {

View file

@ -13,7 +13,6 @@ const keys = webdriver.Key;
const by = webdriver.By; const by = webdriver.By;
const until = webdriver.until; const until = webdriver.until;
describe("Logging into popular sites", function () { describe("Logging into popular sites", function () {
describe("GitHub", function () { describe("GitHub", function () {