runtime/helpers.js
function(url, waitInSeconds) {

        // use either passed in timeout or global default
        var timeout = (waitInSeconds) ? (waitInSeconds * 1000) : DEFAULT_TIMEOUT;

        // load the url and wait for it to complete
        return driver.get(url).then(function() {

            // now wait for the body element to be present
            return driver.wait(until.elementLocated(by.css('body')), timeout);
        });
    }
function(url, waitInSeconds) {

        // use either passed in timeout or global default
        var timeout = (waitInSeconds) ? (waitInSeconds * 1000) : DEFAULT_TIMEOUT;

        // load the url and wait for it to complete
        return driver.get(url).then(function() {

            // now wait for the body element to be present
            return driver.wait(until.elementLocated(by.css('body')), timeout);
        });
    }
function ( url , waitInSeconds ) { // use either passed in timeout or global default var timeout = ( waitInSeconds ) ? ( waitInSeconds * 1000 ) : DEFAULT_TIMEOUT ; // load the url and wait for it to complete return driver . get ( url ) . then ( function ( ) { // now wait for the body element to be present return driver . wait ( until . elementLocated ( by . css ( 'body' ) ) , timeout ) ; } ) ; }
returns a promise that is called when the url has loaded and the body element is present
@param {string} url - url to load
@param {integer} waitInSeconds - number of seconds to wait for page to load
@returns {Promise} resolved when url has loaded otherwise rejects
@example
helpers.loadPage('http://www.google.com');
returns a promise that is called when the url has loaded and the body element is present