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 testServer = require("./lib/server");
describe("Basic", function () {
describe("Basic Functionality", function () {
const svgTestScript = injected.testSVGTestScript();
let httpServer;
let testUrl;
this.timeout = function () {
return 10000;
};
describe("blocking", function () {
this.timeout = function () {
return 20000;
};
it("SVG Not Blocking", function (done) {
this.timeout = function () {
return 10000;
};
const [server, url] = testServer.start();
testUrl = url;
@ -50,6 +54,10 @@ describe("Basic", function () {
it("SVG blocking", function (done) {
this.timeout = function () {
return 10000;
};
const [server, url] = testServer.start();
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">
<html>
<head>
@ -89,7 +101,7 @@ describe("Basic", function () {
</body>
</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);
@ -105,8 +117,8 @@ describe("Basic", function () {
return utils.promiseSetBlockingRules(driver, standardsToBlock);
})
.then(() => driverReference.get(testUrl))
.then(() => driverReference.executeAsyncScript(iframeContentWindowScript))
.then(function (output) {
.then(() => driverReference.executeScript(iframeContentWindowScript))
.then(function () {
driverReference.quit();
testServer.stop(httpServer);
done();
@ -116,6 +128,7 @@ describe("Basic", function () {
testServer.stop(httpServer);
done(e);
});
})
});
});
});

View file

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

View file

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