Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
# Defines a noop initialize method intended to be
  # overridden by the user when extending a Widget base class
  initialize: ->

  world: World

  # use a getter to lazily initialize driver
  @getter 'driver', ->
    @_driver || World.driver

  click: (opts) ->
    @find(opts).then (el) ->
      el.click()

  fill: (opts) ->
    if !opts and !opts.value?
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill")

    if _.isObject(opts)
      @find(opts.selector).then (el) ->
        el.clear().then ->
          el.sendKeys.apply(el, Array::slice.call(opts.value))
    else
      @find().then (el) ->
        el.clear().then ->
          el.sendKeys.apply(el, Array::slice.call(opts))

  read: (opts) ->
    if _.isString(opts) or opts is undefined
      @find(opts).then (el) -> el.getText()

    else
      _.defaults opts,
        transformer: (value) -> value
        selector: null

      @find(opts.selector).then (el) ->
        return el.getText().then opts.transformer

  getValue: (opts={}) ->
    if _.isString(opts)
      opts = {selector: opts}
```

Response:
// Defines a noop initialize method intended to be
// overridden by the user when extending a Widget base class
({
  initialize: function() {},
  world: World
});

// use a getter to lazily initialize driver
this.getter('driver', function() {
  return this._driver || World.driver;
});

({
  click: function(opts) {
    return this.find(opts).then(function(el) {
      return el.click();
    });
  },
  fill: function(opts) {
    if (!opts && (opts.value == null)) {
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill");
    }
    if (_.isObject(opts)) {
      return this.find(opts.selector).then(function(el) {
        return el.clear().then(function() {
          return el.sendKeys.apply(el, Array.prototype.slice.call(opts.value));
        });
      });
    } else {
      return this.find().then(function(el) {
        return el.clear().then(function() {
          return el.sendKeys.apply(el, Array.prototype.slice.call(opts));
        });
      });
    }
  },
  read: function(opts) {
    if (_.isString(opts) || opts === void 0) {
      return this.find(opts).then(function(el) {
        return el.getText();
      });
    } else {
      _.defaults(opts, {
        transformer: function(value) {
          return value;
        },
        selector: null
      });
      return this.find(opts.selector).then(function(el) {
        return el.getText().then(opts.transformer);
      });
    }
  },
  getValue: function(opts = {}) {
    if (_.isString(opts)) {
      return opts = {
        selector: opts
      };
    }
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
// Defines a noop initialize method intended to be
// overridden by the user when extending a Widget base class
({
  initialize: function() {},
  world: World
});

// use a getter to lazily initialize driver
this.getter('driver', function() {
  return this._driver || World.driver;
});

({
  click: function(opts) {
    return this.find(opts).then(function(el) {
      return el.click();
    });
  },
  fill: function(opts) {
    if (!opts && (opts.value == null)) {
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill");
    }
    if (_.isObject(opts)) {
      return this.find(opts.selector).then(function(el) {
        return el.clear().then(function() {
          return el.sendKeys.apply(el, Array.prototype.slice.call(opts.value));
        });
      });
    } else {
      return this.find().then(function(el) {
        return el.clear().then(function() {
          return el.sendKeys.apply(el, Array.prototype.slice.call(opts));
        });
      });
    }
  },
  read: function(opts) {
    if (_.isString(opts) || opts === void 0) {
      return this.find(opts).then(function(el) {
        return el.getText();
      });
    } else {
      _.defaults(opts, {
        transformer: function(value) {
          return value;
        },
        selector: null
      });
      return this.find(opts.selector).then(function(el) {
        return el.getText().then(opts.transformer);
      });
    }
  },
  getValue: function(opts = {}) {
    if (_.isString(opts)) {
      return opts = {
        selector: opts
      };
    }
  }
});
```

Response:
# Defines a noop initialize method intended to be
  # overridden by the user when extending a Widget base class
  initialize: ->

  world: World

  # use a getter to lazily initialize driver
  @getter 'driver', ->
    @_driver || World.driver

  click: (opts) ->
    @find(opts).then (el) ->
      el.click()

  fill: (opts) ->
    if !opts and !opts.value?
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill")

    if _.isObject(opts)
      @find(opts.selector).then (el) ->
        el.clear().then ->
          el.sendKeys.apply(el, Array::slice.call(opts.value))
    else
      @find().then (el) ->
        el.clear().then ->
          el.sendKeys.apply(el, Array::slice.call(opts))

  read: (opts) ->
    if _.isString(opts) or opts is undefined
      @find(opts).then (el) -> el.getText()

    else
      _.defaults opts,
        transformer: (value) -> value
        selector: null

      @find(opts.selector).then (el) ->
        return el.getText().then opts.transformer

  getValue: (opts={}) ->
    if _.isString(opts)
      opts = {selector: opts}


Prompt:
# Defines a noop initialize method intended to be
  # overridden by the user when extending a Widget base class
  initialize: ->

  world: World

  # use a getter to lazily initialize driver
  @getter 'driver', ->
    @_driver || World.driver

  click: (opts) ->
    @find(opts).then (el) ->
      el.click()

  fill: (opts) ->
    if !opts and !opts.value?
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill")

    if _.isObject(opts)
      @find(opts.selector).then (el) ->
        el.clear().then ->

Response:
el.sendKeys.apply(el, Array::slice.call(opts.value))
    else
      @find().then (el) ->
        el.clear().then ->
          el.sendKeys.apply(el, Array::slice.call(opts))

  read: (opts) ->
    if _.isString(opts) or opts is undefined
      @find(opts).then (el) -> el.getText()

    else
      _.defaults opts,
        transformer: (value) -> value
        selector: null

      @find(opts.selector).then (el) ->
        return el.getText().then opts.transformer

  getValue: (opts={}) ->
    if _.isString(opts)
      opts = {selector: opts}


Response:
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else
        return @el.findElement(Driver.By.css(opts.selector))

      return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (opts) ->
    if _.isString(opts)
      opts = {attribute: opts}
    @find(opts).then (el) -> el.getAttribute(opts.attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else
        return @el.findElement(Driver.By.css(opts.selector))

      return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (opts) ->
    if _.isString(opts)
      opts = {attribute: opts}
    @find(opts).then (el) -> el.getAttribute(opts.attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()
```

Response:
_.defaults(opts, {
  transformer: function(val) {
    return val;
  }
});

this.find(opts).then(function(el) {
  return el.getAttribute('value').then(opts.transformer);
});

({
  find: function(opts) {
    var deferred;
    deferred = new $.Deferred();
    if (!opts || _.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    if (opts.text) {
      return this._findByText(opts);
    }
    if (this.el) {
      if (!opts.selector) {
        deferred.fulfill(this.el);
      } else {
        return this.el.findElement(Driver.By.css(opts.selector));
      }
      return deferred;
    }
    return this._ensureElement(opts.selector).then(() => {
      return this.driver.findElement(Driver.By.css(this._selector(opts.selector)));
    });
  },
  getHtml: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  getText: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getText();
    });
  },
  getAttribute: function(opts) {
    if (_.isString(opts)) {
      opts = {
        attribute: opts
      };
    }
    return this.find(opts).then(function(el) {
      return el.getAttribute(opts.attribute);
    });
  },
  getInnerHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getInnerHtml();
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
_.defaults(opts, {
  transformer: function(val) {
    return val;
  }
});

this.find(opts).then(function(el) {
  return el.getAttribute('value').then(opts.transformer);
});

({
  find: function(opts) {
    var deferred;
    deferred = new $.Deferred();
    if (!opts || _.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    if (opts.text) {
      return this._findByText(opts);
    }
    if (this.el) {
      if (!opts.selector) {
        deferred.fulfill(this.el);
      } else {
        return this.el.findElement(Driver.By.css(opts.selector));
      }
      return deferred;
    }
    return this._ensureElement(opts.selector).then(() => {
      return this.driver.findElement(Driver.By.css(this._selector(opts.selector)));
    });
  },
  getHtml: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  getText: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getText();
    });
  },
  getAttribute: function(opts) {
    if (_.isString(opts)) {
      opts = {
        attribute: opts
      };
    }
    return this.find(opts).then(function(el) {
      return el.getAttribute(opts.attribute);
    });
  },
  getInnerHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getInnerHtml();
    });
  }
});
```

Response:
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else
        return @el.findElement(Driver.By.css(opts.selector))

      return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (opts) ->
    if _.isString(opts)
      opts = {attribute: opts}
    @find(opts).then (el) -> el.getAttribute(opts.attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()


Prompt:
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else

Response:
return @el.findElement(Driver.By.css(opts.selector))

      return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (opts) ->
    if _.isString(opts)
      opts = {attribute: opts}
    @find(opts).then (el) -> el.getAttribute(opts.attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()


Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  hasClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript((el, className) ->
        el.classList.contains className
      , el, opts.className)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  hasClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript((el, className) ->
        el.classList.contains className
      , el, opts.className)
```

Response:
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    if (this._selector(selector) !== "undefined") {
      return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
    } else {
      return this.el.isDisplayed();
    }
  },
  isVisible: function(opts = {}) {
    if (_.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    return this.isPresent(opts.selector).then((present) => {
      if (present) {
        return this.find(opts).then(function(elm) {
          return elm.isDisplayed();
        });
      } else {
        return false;
      }
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  hasClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript(function(el, className) {
        return el.classList.contains(className);
      }, el, opts.className);
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    if (this._selector(selector) !== "undefined") {
      return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
    } else {
      return this.el.isDisplayed();
    }
  },
  isVisible: function(opts = {}) {
    if (_.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    return this.isPresent(opts.selector).then((present) => {
      if (present) {
        return this.find(opts).then(function(elm) {
          return elm.isDisplayed();
        });
      } else {
        return false;
      }
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  hasClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript(function(el, className) {
        return el.classList.contains(className);
      }, el, opts.className);
    });
  }
});
```

Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  hasClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript((el, className) ->
        el.classList.contains className
      , el, opts.className)


Prompt:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}

Response:
@find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  hasClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript((el, className) ->
        el.classList.contains className
      , el, opts.className)


Response:
findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this
```

Response:
({
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  },
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  },
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), global.timeout, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  },
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  },
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), global.timeout, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});
```

Response:
findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,

Response:
"#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Response:
# Defines a noop initialize method intended to be
  # overridden by the user when extending a Widget base class
  initialize: ->

  world: World

  # use a getter to lazily initialize driver
  @getter 'driver', ->
    @_driver || World.driver

  click: (opts) ->
    @find(opts).then (el) ->
      el.click()

  fill: (opts) ->
    if !opts and !opts.value?
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill")

    if _.isObject(opts)
      @find(opts.selector).then (el) ->
        el.sendKeys.apply(el, Array::slice.call(opts.value))
    else
      @find().then (el) ->
        el.sendKeys.apply(el, Array::slice.call(opts))

  read: (opts) ->
    if _.isString(opts) or opts is undefined
      @find(opts).then (el) -> el.getText()

    else
      _.defaults opts,
        transformer: (value) -> value
        selector: null

      @find(opts.selector).then (el) ->
        return el.getText().then opts.transformer

  getValue: (opts={}) ->
    if _.isString(opts)
      opts = {selector: opts}


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
# Defines a noop initialize method intended to be
  # overridden by the user when extending a Widget base class
  initialize: ->

  world: World

  # use a getter to lazily initialize driver
  @getter 'driver', ->
    @_driver || World.driver

  click: (opts) ->
    @find(opts).then (el) ->
      el.click()

  fill: (opts) ->
    if !opts and !opts.value?
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill")

    if _.isObject(opts)
      @find(opts.selector).then (el) ->
        el.sendKeys.apply(el, Array::slice.call(opts.value))
    else
      @find().then (el) ->
        el.sendKeys.apply(el, Array::slice.call(opts))

  read: (opts) ->
    if _.isString(opts) or opts is undefined
      @find(opts).then (el) -> el.getText()

    else
      _.defaults opts,
        transformer: (value) -> value
        selector: null

      @find(opts.selector).then (el) ->
        return el.getText().then opts.transformer

  getValue: (opts={}) ->
    if _.isString(opts)
      opts = {selector: opts}
```

Response:
// Defines a noop initialize method intended to be
// overridden by the user when extending a Widget base class
({
  initialize: function() {},
  world: World
});

// use a getter to lazily initialize driver
this.getter('driver', function() {
  return this._driver || World.driver;
});

({
  click: function(opts) {
    return this.find(opts).then(function(el) {
      return el.click();
    });
  },
  fill: function(opts) {
    if (!opts && (opts.value == null)) {
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill");
    }
    if (_.isObject(opts)) {
      return this.find(opts.selector).then(function(el) {
        return el.sendKeys.apply(el, Array.prototype.slice.call(opts.value));
      });
    } else {
      return this.find().then(function(el) {
        return el.sendKeys.apply(el, Array.prototype.slice.call(opts));
      });
    }
  },
  read: function(opts) {
    if (_.isString(opts) || opts === void 0) {
      return this.find(opts).then(function(el) {
        return el.getText();
      });
    } else {
      _.defaults(opts, {
        transformer: function(value) {
          return value;
        },
        selector: null
      });
      return this.find(opts.selector).then(function(el) {
        return el.getText().then(opts.transformer);
      });
    }
  },
  getValue: function(opts = {}) {
    if (_.isString(opts)) {
      return opts = {
        selector: opts
      };
    }
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
// Defines a noop initialize method intended to be
// overridden by the user when extending a Widget base class
({
  initialize: function() {},
  world: World
});

// use a getter to lazily initialize driver
this.getter('driver', function() {
  return this._driver || World.driver;
});

({
  click: function(opts) {
    return this.find(opts).then(function(el) {
      return el.click();
    });
  },
  fill: function(opts) {
    if (!opts && (opts.value == null)) {
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill");
    }
    if (_.isObject(opts)) {
      return this.find(opts.selector).then(function(el) {
        return el.sendKeys.apply(el, Array.prototype.slice.call(opts.value));
      });
    } else {
      return this.find().then(function(el) {
        return el.sendKeys.apply(el, Array.prototype.slice.call(opts));
      });
    }
  },
  read: function(opts) {
    if (_.isString(opts) || opts === void 0) {
      return this.find(opts).then(function(el) {
        return el.getText();
      });
    } else {
      _.defaults(opts, {
        transformer: function(value) {
          return value;
        },
        selector: null
      });
      return this.find(opts.selector).then(function(el) {
        return el.getText().then(opts.transformer);
      });
    }
  },
  getValue: function(opts = {}) {
    if (_.isString(opts)) {
      return opts = {
        selector: opts
      };
    }
  }
});
```

Response:
# Defines a noop initialize method intended to be
  # overridden by the user when extending a Widget base class
  initialize: ->

  world: World

  # use a getter to lazily initialize driver
  @getter 'driver', ->
    @_driver || World.driver

  click: (opts) ->
    @find(opts).then (el) ->
      el.click()

  fill: (opts) ->
    if !opts and !opts.value?
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill")

    if _.isObject(opts)
      @find(opts.selector).then (el) ->
        el.sendKeys.apply(el, Array::slice.call(opts.value))
    else
      @find().then (el) ->
        el.sendKeys.apply(el, Array::slice.call(opts))

  read: (opts) ->
    if _.isString(opts) or opts is undefined
      @find(opts).then (el) -> el.getText()

    else
      _.defaults opts,
        transformer: (value) -> value
        selector: null

      @find(opts.selector).then (el) ->
        return el.getText().then opts.transformer

  getValue: (opts={}) ->
    if _.isString(opts)
      opts = {selector: opts}


Prompt:
# Defines a noop initialize method intended to be
  # overridden by the user when extending a Widget base class
  initialize: ->

  world: World

  # use a getter to lazily initialize driver
  @getter 'driver', ->
    @_driver || World.driver

  click: (opts) ->
    @find(opts).then (el) ->
      el.click()

  fill: (opts) ->
    if !opts and !opts.value?
      throw new Error("You must pass a value to fill with. https://github.com/mojotech/pioneer/blob/master/docs/widget.md#fill")

    if _.isObject(opts)
      @find(opts.selector).then (el) ->

Response:
el.sendKeys.apply(el, Array::slice.call(opts.value))
    else
      @find().then (el) ->
        el.sendKeys.apply(el, Array::slice.call(opts))

  read: (opts) ->
    if _.isString(opts) or opts is undefined
      @find(opts).then (el) -> el.getText()

    else
      _.defaults opts,
        transformer: (value) -> value
        selector: null

      @find(opts.selector).then (el) ->
        return el.getText().then opts.transformer

  getValue: (opts={}) ->
    if _.isString(opts)
      opts = {selector: opts}


Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')
```

Response:
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    if (this._selector(selector) !== "undefined") {
      return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
    } else {
      return this.el.isDisplayed();
    }
  },
  isVisible: function(opts = {}) {
    if (_.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    return this.isPresent(opts.selector).then((present) => {
      if (present) {
        return this.find(opts).then(function(elm) {
          return elm.isDisplayed();
        });
      } else {
        return false;
      }
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    if (this._selector(selector) !== "undefined") {
      return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
    } else {
      return this.el.isDisplayed();
    }
  },
  isVisible: function(opts = {}) {
    if (_.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    return this.isPresent(opts.selector).then((present) => {
      if (present) {
        return this.find(opts).then(function(elm) {
          return elm.isDisplayed();
        });
      } else {
        return false;
      }
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  }
});
```

Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')


Prompt:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    if @_selector(selector) != "undefined"
      @driver.isElementPresent(Driver.By.css(@_selector(selector)))
    else
      @el.isDisplayed()

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)

Response:
opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')


Response:
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this
```

Response:
({
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  },
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), global.timeout, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  },
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), global.timeout, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});
```

Response:
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      global.timeout,
      "#{@_selector(selector)} not found"
    )

Response:
sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Response:
_      = require('lodash')
Driver = require('selenium-webdriver')
$      = Driver.promise

@W = class @Widget
  @extend: (protoProps, staticProps) ->
    parent = @
    if Object.hasOwnProperty(protoProps, 'constructor')
      child = protoProps.constructor
    else
      child = -> parent.apply(@, arguments)

    child.copyProperties @
    child.copyProperties staticProps

    Surrogate = ->
      @constructor = child
      return undefined

    Surrogate.prototype = @::
    child.prototype = new Surrogate()

    child::.copyProperties(protoProps) if protoProps

    child.__super__ = @::

    child

  @find = (attributes) ->
    _this = _.extend(new this, attributes)

    _this.find().then (el) ->
      _this.el = el
      _this

  constructor: (attributes = {}) ->
    _.extend @, attributes

    @initialize.apply @, arguments


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_      = require('lodash')
Driver = require('selenium-webdriver')
$      = Driver.promise

@W = class @Widget
  @extend: (protoProps, staticProps) ->
    parent = @
    if Object.hasOwnProperty(protoProps, 'constructor')
      child = protoProps.constructor
    else
      child = -> parent.apply(@, arguments)

    child.copyProperties @
    child.copyProperties staticProps

    Surrogate = ->
      @constructor = child
      return undefined

    Surrogate.prototype = @::
    child.prototype = new Surrogate()

    child::.copyProperties(protoProps) if protoProps

    child.__super__ = @::

    child

  @find = (attributes) ->
    _this = _.extend(new this, attributes)

    _this.find().then (el) ->
      _this.el = el
      _this

  constructor: (attributes = {}) ->
    _.extend @, attributes

    @initialize.apply @, arguments
```

Response:
var $, Driver, _;

_ = require('lodash');

Driver = require('selenium-webdriver');

$ = Driver.promise;

this.W = this.Widget = class Widget {
  static extend(protoProps, staticProps) {
    var Surrogate, child, parent;
    parent = this;
    if (Object.hasOwnProperty(protoProps, 'constructor')) {
      child = protoProps.constructor;
    } else {
      child = function() {
        return parent.apply(this, arguments);
      };
    }
    child.copyProperties(this);
    child.copyProperties(staticProps);
    Surrogate = function() {
      this.constructor = child;
      return void 0;
    };
    Surrogate.prototype = this.prototype;
    child.prototype = new Surrogate();
    if (protoProps) {
      child.prototype.copyProperties(protoProps);
    }
    child.__super__ = this.prototype;
    return child;
  }

  static find(attributes) {
    var _this;
    _this = _.extend(new (this)(), attributes);
    return _this.find().then(function(el) {
      _this.el = el;
      return _this;
    });
  }

  constructor(attributes = {}) {
    _.extend(this, attributes);
    this.initialize.apply(this, arguments);
  }

};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var $, Driver, _;

_ = require('lodash');

Driver = require('selenium-webdriver');

$ = Driver.promise;

this.W = this.Widget = class Widget {
  static extend(protoProps, staticProps) {
    var Surrogate, child, parent;
    parent = this;
    if (Object.hasOwnProperty(protoProps, 'constructor')) {
      child = protoProps.constructor;
    } else {
      child = function() {
        return parent.apply(this, arguments);
      };
    }
    child.copyProperties(this);
    child.copyProperties(staticProps);
    Surrogate = function() {
      this.constructor = child;
      return void 0;
    };
    Surrogate.prototype = this.prototype;
    child.prototype = new Surrogate();
    if (protoProps) {
      child.prototype.copyProperties(protoProps);
    }
    child.__super__ = this.prototype;
    return child;
  }

  static find(attributes) {
    var _this;
    _this = _.extend(new (this)(), attributes);
    return _this.find().then(function(el) {
      _this.el = el;
      return _this;
    });
  }

  constructor(attributes = {}) {
    _.extend(this, attributes);
    this.initialize.apply(this, arguments);
  }

};
```

Response:
_      = require('lodash')
Driver = require('selenium-webdriver')
$      = Driver.promise

@W = class @Widget
  @extend: (protoProps, staticProps) ->
    parent = @
    if Object.hasOwnProperty(protoProps, 'constructor')
      child = protoProps.constructor
    else
      child = -> parent.apply(@, arguments)

    child.copyProperties @
    child.copyProperties staticProps

    Surrogate = ->
      @constructor = child
      return undefined

    Surrogate.prototype = @::
    child.prototype = new Surrogate()

    child::.copyProperties(protoProps) if protoProps

    child.__super__ = @::

    child

  @find = (attributes) ->
    _this = _.extend(new this, attributes)

    _this.find().then (el) ->
      _this.el = el
      _this

  constructor: (attributes = {}) ->
    _.extend @, attributes

    @initialize.apply @, arguments


Prompt:
_      = require('lodash')
Driver = require('selenium-webdriver')
$      = Driver.promise

@W = class @Widget
  @extend: (protoProps, staticProps) ->
    parent = @
    if Object.hasOwnProperty(protoProps, 'constructor')
      child = protoProps.constructor
    else
      child = -> parent.apply(@, arguments)

    child.copyProperties @
    child.copyProperties staticProps

    Surrogate = ->
      @constructor = child
      return undefined

Response:
Surrogate.prototype = @::
    child.prototype = new Surrogate()

    child::.copyProperties(protoProps) if protoProps

    child.__super__ = @::

    child

  @find = (attributes) ->
    _this = _.extend(new this, attributes)

    _this.find().then (el) ->
      _this.el = el
      _this

  constructor: (attributes = {}) ->
    _.extend @, attributes

    @initialize.apply @, arguments


Response:
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this
```

Response:
({
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  },
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  },
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});
```

Response:
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
_findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )

  _ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

Response:
sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )
```

Response:
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
  },
  isVisible: function(opts = {}) {
    if (_.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    return this.isPresent(opts.selector).then((present) => {
      if (present) {
        return this.find(opts).then(function(elm) {
          return elm.isDisplayed();
        });
      } else {
        return false;
      }
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  },
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
  },
  isVisible: function(opts = {}) {
    if (_.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    return this.isPresent(opts.selector).then((present) => {
      if (present) {
        return this.find(opts).then(function(elm) {
          return elm.isDisplayed();
        });
      } else {
        return false;
      }
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  },
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  }
});
```

Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )


Prompt:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts={}) ->
    if(_.isString(opts))
      opts = {selector: opts}
    @isPresent(opts.selector).then (present) =>
      if(present)
        @find(opts).then (elm) -> elm.isDisplayed()
      else
        false

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}

Response:
@find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )


Response:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this
```

Response:
({
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  },
  doubleClick: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).doubleClick(el).perform().then(() => {
        return this;
      });
    });
  }
});
```

Response:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Prompt:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>

Response:
new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this

  doubleClick: (opts) ->
    @find(opts)
    .then (el) =>
      new Driver.ActionSequence(@driver)
      .doubleClick(el)
      .perform()
      .then => this


Response:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this
```

Response:
({
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  },
  hover: function(opts) {
    return this.find(opts).then((el) => {
      return new Driver.ActionSequence(this.driver).mouseMove(el).perform().then(() => {
        return this;
      });
    });
  }
});
```

Response:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this


Prompt:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->

Response:
@find().then (el) -> el.sendKeys.apply(el, args)

  hover: (opts) ->
    @find(opts).then (el) =>
      new Driver.ActionSequence(@driver)
      .mouseMove(el)
      .perform()
      .then => this


Response:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)
```

Response:
({
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  _ensureElement: function(selector) {
    return this.driver.wait(_.bind(this.isPresent, this, selector), 10000, `${this._selector(selector)} not found`);
  },
  sendKeys: function(...args) {
    return this.find().then(function(el) {
      return el.sendKeys.apply(el, args);
    });
  }
});
```

Response:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,
      "#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)


Prompt:
_ensureElement: (selector) ->
    @driver.wait(
      _.bind(@isPresent, this, selector),
      10000,

Response:
"#{@_selector(selector)} not found"
    )

  sendKeys: (args...)->
    @find().then (el) -> el.sendKeys.apply(el, args)


Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts) ->
    @find(opts).then (elm) -> elm.isDisplayed()

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts) ->
    @find(opts).then (elm) -> elm.isDisplayed()

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )
```

Response:
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
  },
  isVisible: function(opts) {
    return this.find(opts).then(function(elm) {
      return elm.isDisplayed();
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  },
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  isPresent: function(selector) {
    return this.driver.isElementPresent(Driver.By.css(this._selector(selector)));
  },
  isVisible: function(opts) {
    return this.find(opts).then(function(elm) {
      return elm.isDisplayed();
    });
  },
  addClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className);
    });
  },
  removeClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className);
    });
  },
  toggleClass: function(opts) {
    if (_.isString(opts)) {
      opts = {
        className: opts
      };
    }
    return this.find(opts.selector).then((el) => {
      return this.driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className);
    });
  },
  findAll: function(selector) {
    return this.driver.findElements(Driver.By.css(this._selector(selector)));
  },
  _selector: function(selector) {
    return this.root + (selector ? ` ${selector}` : '');
  },
  _findByText: function(opts) {
    return this.find().then(function(el) {
      // WebDriver lets you go out of the child scope
      // if you pass an absolute xpath selector
      // this is a bug in WebDriver and is terrible
      // by passing a `.` this is no longer an issue.
      return el.findElement(Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]'));
    });
  }
});
```

Response:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts) ->
    @find(opts).then (elm) -> elm.isDisplayed()

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

  toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )


Prompt:
getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()

  isPresent: (selector) ->
    @driver.isElementPresent(Driver.By.css(@_selector(selector)))

  isVisible: (opts) ->
    @find(opts).then (elm) -> elm.isDisplayed()

  addClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.add(arguments[1])", el, opts.className)

  removeClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.remove(arguments[1])", el, opts.className)

Response:
toggleClass: (opts) ->
    if _.isString(opts)
      opts = {className: opts}
    @find(opts.selector).then (el) =>
      @driver.executeScript("arguments[0].classList.toggle(arguments[1])", el, opts.className)

  findAll: (selector) ->
    @driver.findElements(Driver.By.css(@_selector(selector)))

  _selector: (selector) ->
    @root + (if selector then " #{selector}" else '')

  _findByText: (opts) ->
    @find().then (el) ->
      el.findElement(
        # WebDriver lets you go out of the child scope
        # if you pass an absolute xpath selector
        # this is a bug in WebDriver and is terrible
        # by passing a `.` this is no longer an issue.
        Driver.By.xpath('.//*[normalize-space(text())=normalize-space("' + opts.text + '")]')
      )


Response:
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else
        return @el.findElement(Driver.By.css(opts.selector))

      return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (attribute) ->
    @find().then (el) -> el.getAttribute(attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()

  getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else
        return @el.findElement(Driver.By.css(opts.selector))

      return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (attribute) ->
    @find().then (el) -> el.getAttribute(attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()

  getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()
```

Response:
_.defaults(opts, {
  transformer: function(val) {
    return val;
  }
});

this.find(opts).then(function(el) {
  return el.getAttribute('value').then(opts.transformer);
});

({
  find: function(opts) {
    var deferred;
    deferred = new $.Deferred();
    if (!opts || _.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    if (opts.text) {
      return this._findByText(opts);
    }
    if (this.el) {
      if (!opts.selector) {
        deferred.fulfill(this.el);
      } else {
        return this.el.findElement(Driver.By.css(opts.selector));
      }
      return deferred;
    }
    return this._ensureElement(opts.selector).then(() => {
      return this.driver.findElement(Driver.By.css(this._selector(opts.selector)));
    });
  },
  getHtml: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  getText: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getText();
    });
  },
  getAttribute: function(attribute) {
    return this.find().then(function(el) {
      return el.getAttribute(attribute);
    });
  },
  getInnerHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getInnerHtml();
    });
  },
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
_.defaults(opts, {
  transformer: function(val) {
    return val;
  }
});

this.find(opts).then(function(el) {
  return el.getAttribute('value').then(opts.transformer);
});

({
  find: function(opts) {
    var deferred;
    deferred = new $.Deferred();
    if (!opts || _.isString(opts)) {
      opts = {
        selector: opts
      };
    }
    if (opts.text) {
      return this._findByText(opts);
    }
    if (this.el) {
      if (!opts.selector) {
        deferred.fulfill(this.el);
      } else {
        return this.el.findElement(Driver.By.css(opts.selector));
      }
      return deferred;
    }
    return this._ensureElement(opts.selector).then(() => {
      return this.driver.findElement(Driver.By.css(this._selector(opts.selector)));
    });
  },
  getHtml: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  },
  getText: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getText();
    });
  },
  getAttribute: function(attribute) {
    return this.find().then(function(el) {
      return el.getAttribute(attribute);
    });
  },
  getInnerHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getInnerHtml();
    });
  },
  getOuterHTML: function(opts) {
    return this.find(opts).then(function(el) {
      return el.getOuterHtml();
    });
  }
});
```

Response:
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else
        return @el.findElement(Driver.By.css(opts.selector))

      return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (attribute) ->
    @find().then (el) -> el.getAttribute(attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()

  getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()


Prompt:
_.defaults opts,
      transformer: (val) -> val

    @find(opts).then (el) ->
      el.getAttribute('value').then opts.transformer

  find: (opts) ->
    deferred = new $.Deferred

    if (!opts or _.isString(opts))
      opts = {selector: opts}

    if (opts.text)
      return @_findByText(opts)

    if (@el)
      if !opts.selector
        deferred.fulfill(@el)
      else
        return @el.findElement(Driver.By.css(opts.selector))

Response:
return deferred

    @_ensureElement(opts.selector).then =>
      @driver.findElement(Driver.By.css(@_selector(opts.selector)))

  getHtml: (opts) ->
     @find(opts).then (el) -> el.getOuterHtml()

  getText: (opts) ->
    @find(opts).then (el) -> el.getText()

  getAttribute: (attribute) ->
    @find().then (el) -> el.getAttribute(attribute)

  getInnerHTML: (opts) ->
    @find(opts).then (el) -> el.getInnerHtml()

  getOuterHTML: (opts) ->
    @find(opts).then (el) -> el.getOuterHtml()