diff --git a/src/test/e2e/index.js b/src/test/e2e/index.js index 6b97a0d8..93496809 100644 --- a/src/test/e2e/index.js +++ b/src/test/e2e/index.js @@ -27,10 +27,9 @@ var driver = new webdriver.Builder(). * Checks console errors and fails if there is any error * Note: It's a good idea to run this after each operation */ -function checkConsoleErros () { +function checkConsoleErrors () { it('should not have any console errors', function (done) { driver.manage().logs().get('browser').then(function(browserLogs) { - var errors = []; browserLogs.forEach(function(log){ @@ -41,7 +40,6 @@ function checkConsoleErros () { errors.push(log); } }); - expect(errors).to.be.empty; done(); @@ -49,35 +47,30 @@ function checkConsoleErros () { }); } -describe('basics', function () { - +describe('basics', function (done) { this.timeout(10 * 1000); beforeEach(function () { - driver.get('http://localhost:' + PORT); + driver.get('http://localhost:' + PORT + '/index.html'); }); it('should have "Swagger UI" in title', function (done) { - driver.wait(function() { return driver.getTitle().then(function(title) { var hasTitle = title.indexOf('Swagger UI') > -1; if (hasTitle) { expect(title).to.contain('Swagger UI'); + checkConsoleErrors(); done(); } - return hasTitle; }); }, 1000); }); - - checkConsoleErros(); }); describe('cleanup', function () { - it('kills the static server', function () { server.close(); }); @@ -85,7 +78,4 @@ describe('cleanup', function () { it('quit the webdriver', function () { driver.quit(); }); -}) - - - +}) \ No newline at end of file diff --git a/src/test/spec.html b/src/test/spec.html deleted file mode 100644 index 6ced497a..00000000 --- a/src/test/spec.html +++ /dev/null @@ -1,26 +0,0 @@ - - - swagger-ui specs - - - - - - - - - - - - - -
- - - - \ No newline at end of file