From b2cd855aa8418cf69adf55caabf70f9ba7666534 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 31 Aug 2016 21:58:55 +0300 Subject: [PATCH] Make e2e less verbose + minor fixes --- lib/components/JsonSchema/json-schema.ts | 1 + package.json | 3 ++- tests/e2e/helpers.js | 3 ++- tests/e2e/index.html | 2 +- tests/e2e/redoc.e2e.js | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/components/JsonSchema/json-schema.ts b/lib/components/JsonSchema/json-schema.ts index cee7aa64..3bb1c3c6 100644 --- a/lib/components/JsonSchema/json-schema.ts +++ b/lib/components/JsonSchema/json-schema.ts @@ -54,6 +54,7 @@ export class JsonSchema extends BaseComponent implements OnInit { initDescendants() { this.descendants = this.specMgr.findDerivedDefinitions(this.normPointer); if (!this.descendants.length) return; + this.hasDescendants = true; let discriminator = this.schema.discriminator; let discrProperty = this.schema._properties && this.schema._properties.filter((prop) => prop.name === discriminator)[0]; diff --git a/package.json b/package.json index 12c91f33..5ae87004 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "e2e-server": "http-server -p 3000 tests/e2e", "e2e-copy": "cp dist/redoc.min.js tests/e2e/", "webdriver": "webdriver-manager update", - "serve:prod": "NODE_ENV=production npm start" + "serve:prod": "NODE_ENV=production npm start", + "protractor": "protractor" }, "keywords": [ "OpenAPI", diff --git a/tests/e2e/helpers.js b/tests/e2e/helpers.js index 16aeedd1..4c00744b 100644 --- a/tests/e2e/helpers.js +++ b/tests/e2e/helpers.js @@ -51,7 +51,8 @@ function verifyNoBrowserErrors() { if (message.match(/^Unknown property.*Declaration dropped/)) return false; if (message.match(/^Error in parsing value for.*Declaration dropped/)) return false; if (message.indexOf('The character encoding of the HTML document was not declared') > -1) return false; - if (message.match(/addons.manager\s+DEBUG/)) return false; + if (message.match(/^\d{13}\s+(DeferredSave|addons)/)) return false; + if (message.match(/This site makes use of a SHA-1 Certificate/)) return false; if (logEntry.level.value >= LogLevel.INFO) { diff --git a/tests/e2e/index.html b/tests/e2e/index.html index 2c62cec6..2653b34f 100644 --- a/tests/e2e/index.html +++ b/tests/e2e/index.html @@ -15,7 +15,7 @@ window.redocError = null; /* init redoc */ var url = window.location.search.substr(5) || 'http://rebilly.github.io/SwaggerTemplateRepo/swagger.json'; - Redoc.init(decodeURIComponent(url), {disableLazySchemas: true}).then(function() {}, function(err) { + Redoc.init(decodeURIComponent(url), {disableLazySchemas: true, suppressWarnings: true}).then(function() {}, function(err) { window.redocError = err; }); diff --git a/tests/e2e/redoc.e2e.js b/tests/e2e/redoc.e2e.js index 01c5e940..eaf250e3 100644 --- a/tests/e2e/redoc.e2e.js +++ b/tests/e2e/redoc.e2e.js @@ -91,6 +91,7 @@ if (process.env.JOB === 'e2e-guru') { delete apisGuruList['googleapis.com:mirror']; // bad urls in images delete apisGuruList['googleapis.com:discovery']; // non-string references delete apisGuruList['clarify.io']; // non-string references + delete apisGuruList['clickmeter.com']; // some complex circular reference //delete apisGuruList['pushpay.com']; // https://github.com/Rebilly/ReDoc/issues/30 delete apisGuruList['bbci.co.uk']; // too big