runtime/world.js
function importSupportObjects() {

    // import shared objects from multiple paths (after global vars have been created)
    if (global.sharedObjectPaths && Array.isArray(global.sharedObjectPaths) && global.sharedObjectPaths.length > 0) {

        var allDirs = {};

        // first require directories into objects by directory
        global.sharedObjectPaths.forEach(function (itemPath) {

            if (fs.existsSync(itemPath)) {

                var dir = requireDir(itemPath, { camelcase: true, recurse: true });

                merge(allDirs, dir);
            }
        });

        // if we managed to import some directories, expose them
        if (Object.keys(allDirs).length > 0) {

            // expose globally
            global.shared = allDirs;
        }
    }

    // import page objects (after global vars have been created)
    if (global.pageObjectPath && fs.existsSync(global.pageObjectPath)) {

        // require all page objects using camel case as object names
        global.page = requireDir(global.pageObjectPath, { camelcase: true, recurse: true });
    }

    // add helpers
    global.helpers = require('../runtime/helpers.js');
}
function importSupportObjects() {

    // import shared objects from multiple paths (after global vars have been created)
    if (global.sharedObjectPaths && Array.isArray(global.sharedObjectPaths) && global.sharedObjectPaths.length > 0) {

        var allDirs = {};

        // first require directories into objects by directory
        global.sharedObjectPaths.forEach(function (itemPath) {

            if (fs.existsSync(itemPath)) {

                var dir = requireDir(itemPath, { camelcase: true, recurse: true });

                merge(allDirs, dir);
            }
        });

        // if we managed to import some directories, expose them
        if (Object.keys(allDirs).length > 0) {

            // expose globally
            global.shared = allDirs;
        }
    }

    // import page objects (after global vars have been created)
    if (global.pageObjectPath && fs.existsSync(global.pageObjectPath)) {

        // require all page objects using camel case as object names
        global.page = requireDir(global.pageObjectPath, { camelcase: true, recurse: true });
    }

    // add helpers
    global.helpers = require('../runtime/helpers.js');
}
function importSupportObjects ( ) { // import shared objects from multiple paths (after global vars have been created) if ( global . sharedObjectPaths && Array . isArray ( global . sharedObjectPaths ) && global . sharedObjectPaths . length > 0 ) { var allDirs = { } ; // first require directories into objects by directory global . sharedObjectPaths . forEach ( function ( itemPath ) { if ( fs . existsSync ( itemPath ) ) { var dir = requireDir ( itemPath , { camelcase : true , recurse : true } ) ; merge ( allDirs , dir ) ; } } ) ; // if we managed to import some directories, expose them if ( Object . keys ( allDirs ) . length > 0 ) { // expose globally global . shared = allDirs ; } } // import page objects (after global vars have been created) if ( global . pageObjectPath && fs . existsSync ( global . pageObjectPath ) ) { // require all page objects using camel case as object names global . page = requireDir ( global . pageObjectPath , { camelcase : true , recurse : true } ) ; } // add helpers global . helpers = require ( '../runtime/helpers.js' ) ; }
Import shared objects, pages object and helpers into global scope
@returns {void}
Import shared objects pages object and helpers into global scope