Search code examples
node.jsseleniumangularjs-e2ejasmine-node

Automated e2e testing- WebDriverJS, Jasmine


I'm following this tutorial http://engineering.wingify.com/posts/e2e-testing-with-webdriverjs-jasmine/

First part calls for creating testfile.js

var webdriver = require('selenium-webdriver');

var driver = new webdriver.Builder().
    withCapabilities(webdriver.Capabilities.chrome()).
    build();

driver.get('http://www.wingify.com');

I was able to get the browser to run when I run node testfile.js

I create the testfile.js

$ cat testfile.js

var webdriver = require('selenium-webdriver');

var driver = new webdriver.Builder().
    withCapabilities(webdriver.Capabilities.chrome()).
    build();

describe('basic test', function () {
    it('should be on correct page', function () {
        driver.get('http://www.wingify.com');
        driver.getTitle().then(function(title) {
            expect(title).toBe('Wingify');
        });
    });
});

I get to this part where you run jasmine-node

$ jasmine-node testfile.js 

Finished in 0 seconds
0 tests, 0 assertions, 0 failures, 0 skipped

The expected behavior is that it launches the browser but that is not what I am experiencing.


Solution

  • You need to increase the timeout value by calling:

    jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999;
    

    Take a look at this example gist (I used WebdriverIO here).