src/driver/selector.js
function exposeThenSelector(Browser, command, exposed) {
    if (_.isNumber(exposed)) {
        exposed = command;
    }
    exposed = ['then', ucfirst(exposed)].join('');

    Browser.prototype[exposed] = function () {
        var args = arguments;
        ensureDriverCommand.call(this, command, 'exposeThenSelector');

        this.then(function (next) {
            args = wrapArguments.call(this, args, chainAndErrorCallback, next);
            args = wrapSelectorArguments(args);
            this._driver[command].apply(this._driver, args);
        });

        return this;
    };
}
function exposeThenSelector(Browser, command, exposed) {
    if (_.isNumber(exposed)) {
        exposed = command;
    }
    exposed = ['then', ucfirst(exposed)].join('');

    Browser.prototype[exposed] = function () {
        var args = arguments;
        ensureDriverCommand.call(this, command, 'exposeThenSelector');

        this.then(function (next) {
            args = wrapArguments.call(this, args, chainAndErrorCallback, next);
            args = wrapSelectorArguments(args);
            this._driver[command].apply(this._driver, args);
        });

        return this;
    };
}
function exposeThenSelector ( Browser , command , exposed ) { if ( _ . isNumber ( exposed ) ) { exposed = command ; } exposed = [ 'then' , ucfirst ( exposed ) ] . join ( '' ) ; Browser . prototype [ exposed ] = function ( ) { var args = arguments ; ensureDriverCommand . call ( this , command , 'exposeThenSelector' ) ; this . then ( function ( next ) { args = wrapArguments . call ( this , args , chainAndErrorCallback , next ) ; args = wrapSelectorArguments ( args ) ; this . _driver [ command ] . apply ( this . _driver , args ) ; } ) ; return this ; } ; }
expose a native selector command to promise api. if a callback is given, next is not called automaticly.
expose a native selector command to promise api . if a callback is given next is not called automaticly .