runtime/world.js
function createWorld() {

    var runtime = {
        driver: null,               // the browser object
        eyes: null,
        selenium: selenium,         // the raw nodejs selenium driver
        By: selenium.By,            // in keeping with Java expose selenium By
        by: selenium.By,            // provide a javascript lowercase version
        until: selenium.until,      // provide easy access to selenium until methods
        expect: expect,             // expose chai expect to allow variable testing
        assert: assert,             // expose chai assert to allow variable testing
        trace: consoleInfo,         // expose an info method to log output to the console in a readable/visible format
        page: global.page || {},    // empty page objects placeholder
        shared: global.shared || {} // empty shared objects placeholder
    };

    // expose properties to step definition methods via global variables
    Object.keys(runtime).forEach(function (key) {
        if (key === 'driver' && browserTeardownStrategy !== 'always') {
            return;
        }

        // make property/method available as a global (no this. prefix required)
        global[key] = runtime[key];
    });
}
function createWorld() {

    var runtime = {
        driver: null,               // the browser object
        eyes: null,
        selenium: selenium,         // the raw nodejs selenium driver
        By: selenium.By,            // in keeping with Java expose selenium By
        by: selenium.By,            // provide a javascript lowercase version
        until: selenium.until,      // provide easy access to selenium until methods
        expect: expect,             // expose chai expect to allow variable testing
        assert: assert,             // expose chai assert to allow variable testing
        trace: consoleInfo,         // expose an info method to log output to the console in a readable/visible format
        page: global.page || {},    // empty page objects placeholder
        shared: global.shared || {} // empty shared objects placeholder
    };

    // expose properties to step definition methods via global variables
    Object.keys(runtime).forEach(function (key) {
        if (key === 'driver' && browserTeardownStrategy !== 'always') {
            return;
        }

        // make property/method available as a global (no this. prefix required)
        global[key] = runtime[key];
    });
}
function createWorld ( ) { var runtime = { driver : null , // the browser object eyes : null , selenium : selenium , // the raw nodejs selenium driver By : selenium . By , // in keeping with Java expose selenium By by : selenium . By , // provide a javascript lowercase version until : selenium . until , // provide easy access to selenium until methods expect : expect , // expose chai expect to allow variable testing assert : assert , // expose chai assert to allow variable testing trace : consoleInfo , // expose an info method to log output to the console in a readable/visible format page : global . page || { } , // empty page objects placeholder shared : global . shared || { } // empty shared objects placeholder } ; // expose properties to step definition methods via global variables Object . keys ( runtime ) . forEach ( function ( key ) { if ( key === 'driver' && browserTeardownStrategy !== 'always' ) { return ; } // make property/method available as a global (no this. prefix required) global [ key ] = runtime [ key ] ; } ) ; }
Creates a list of variables to expose globally and therefore accessible within each step definition
@returns {void}
Creates a list of variables to expose globally and therefore accessible within each step definition