Skip to content

Instantly share code, notes, and snippets.

@eddywashere
Created August 14, 2014 20:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eddywashere/5265d5bb91c4240f17b4 to your computer and use it in GitHub Desktop.
Save eddywashere/5265d5bb91c4240f17b4 to your computer and use it in GitHub Desktop.

by.model

<input type="text" ng-model="yourName">

// by.model('yourName')

by.binding

<a href="#someLink">{{linkText}}</a> or <a href="#someLink" ng-bind="linkText">

// by.binding('linkText')

by.repeater

<ul>
  <li ng-repeat="user in users">
      <span>{{user.name}}</span>
  </li>
</ul>

// by.repeater('user in users').row(0).column('name')

by.css (only use this for ng-click)

<button ng-click="sendMail()">Send mail!</button>
// by.css('[ng-click="sendMail()"]')

by.options

<select ng-model="color" ng-options="c for c in colors">
  <option value="0" selected="selected">red</option>
  <option value="1">green</option>
</select>
// or 
<select ng-model="color" ng-options="c for c in colors"></select>
var allOptions = element.all(by.options('c for c in colors'));
expect(allOptions.count()).toEqual(2);
var firstOption = allOptions.first();
expect(firstOption.getText()).toEqual('red');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment