Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(cssShortcut): fix $$ global throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
juliemr committed Jun 5, 2014
1 parent ac34a77 commit 72668fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ var Protractor = function(webdriverInstance, opt_baseUrl, opt_rootElement) {
* @type {function(string): ElementArrayFinder}
*/
this.$$ = function(selector) {
return self.all(webdriver.By.css(selector));
return self.element.all(webdriver.By.css(selector));
};

/**
Expand Down
6 changes: 6 additions & 0 deletions spec/basic/elements_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ describe('shortcut css notation', function() {
beforeEach(function() {
browser.get('index.html#/bindings');
});

it('should grab by css', function() {
expect($('.planet-info').getText()).
toEqual(element(by.css('.planet-info')).getText());
expect($$('option').count()).toEqual(element.all(by.css('option')).count());
});

it('should chain $$ with $', function() {
var withoutShortcutCount =
Expand Down

0 comments on commit 72668fe

Please sign in to comment.