JavaScript Error: done() invoked with non-Error: {} error done() invoked with non-error

I'm trying to set up automatic testing, using Mocha and PhantomJS on Selenium with Node. I'm using selenium-webdriver library since it seems to be a popular one, but when I run the test and try to extract data from a page, it gives me this error:

  1) Test "before each" hook for "Test":
     Error: done() invoked with non-Error: {}
      at ManagedPromise.invokeCallback_ (node_modules/selenium-webdriver/lib/promise.js:1379:14)
      at TaskQueue.execute_ (node_modules/selenium-webdriver/lib/promise.js:2913:14)
      at TaskQueue.executeNext_ (node_modules/selenium-webdriver/lib/promise.js:2896:21)
      at node_modules/selenium-webdriver/lib/promise.js:2775:27
      at node_modules/selenium-webdriver/lib/promise.js:639:7

I'm not sure why this problem is happening, and searching didn't help because the solutions I had didn't fit my scenario; I'm on:

  • Mac OS X 10
  • Node.js v4.4.5
  • PhantomJS 2.1.1

Here's my script:

var selenium = require("selenium-webdriver");
var should = require("should");

var URL = "https://android.com";
var driver;

describe("Test", function() {
    this.timeout(15000);

    beforeEach(function(done) {
        driver = new selenium.Builder()
            .withCapabilities(selenium.Capabilities.phantomjs())
            .build();
        driver.get(URL).then(done);
    });

    /* is this an HTML page? */
    it("Test", function() {
        driver
            .getPageSource()
            .should.eventually
            .match(/(.*)\<\!doctype\ html\>(.*)/i);
    });

    afterEach(function(done) {
        driver.quit().then(done);
    });
});

I've also tried using some gulp scripts I found and other Node.js libraries but they all return different errors ;~;

Answer:1

Ok i have noticed this bug with FireFox and IE 11 how to replicate it: Start scrolling on the fixed column While its scrolling move the mouse over to the other data Result: not aligned rows Live ...

Ok i have noticed this bug with FireFox and IE 11 how to replicate it: Start scrolling on the fixed column While its scrolling move the mouse over to the other data Result: not aligned rows Live ...

  1. jquery datatables vertical scroll
  2. jquery datatables vertical align
  3. jquery datatables vertical header
  4. jquery datatables vertical
  5. jquery datatable vertical scroll not working
  6. jquery datatable vertical scroll header width
  7. jquery datatable vertical align middle
  8. jquery datatable vertical align top
  9. jquery datatable vertical border
  10. jquery datatable remove vertical scrollbar
  11. jquery datatable column vertical align
  12. jquery datatable add vertical scroll
  13. jquery datatable disable vertical scroll
  14. jquery datatable hide vertical scrollbar
  15. jquery datatables fixed header vertical scroll
  16. jquery datatables header misaligned with vertical scrolling
  17. jquery datatable vertical height

I have an option set field in Dynamics CRM that has two values: "In Progress" (default) and "Completed". Using JavaScript, I want to issue a confirm box that triggers during the field event OnChange. ...

I have an option set field in Dynamics CRM that has two values: "In Progress" (default) and "Completed". Using JavaScript, I want to issue a confirm box that triggers during the field event OnChange. ...

  1. dynamics 2016 javascript

I have a page with two textareas and two buttons that copy the content of each textarea respectively to the user's clipboard when pressed. When the button is pressed and the copying is successful, a ...

I have a page with two textareas and two buttons that copy the content of each textarea respectively to the user's clipboard when pressed. When the button is pressed and the copying is successful, a ...

I am having trouble with noUislider, in that I need to be able to differentiate between different sliders when slide events are triggered. I thought (and from reading the noUiSlider GitHub) that I'd ...

I am having trouble with noUislider, in that I need to be able to differentiate between different sliders when slide events are triggered. I thought (and from reading the noUiSlider GitHub) that I'd ...

  1. nouislider slide event