Html:
<class= "List"> <Li ng-repeat = "item in itmes" ng-click= "SelectItem (item)" ng-class = "{selected:item.isSelected}" >{{item.name}}</ Li > </ ul >
// Get by bindingexpect (Element.all (by.binding (' Item.name ')). First (). GetText ()). ToBe (' Ben '); // Get by TagNameexpect (Element ("By.css ('. List ')"). All (By.tagname (' Li ')). Get (2). GetText ()). ToBe (' Sophi ') ; // Get by Repeaterexpect (element (By.repeater (' item in Items '). Row (4). Column (' {{item.name}} '). GetText ()). ToBe (' Herny ');
Notice, when you use Repeater, ' {{item.name}} ' should is prefect match with what is in HTML. Speace between {} also matters.
var listItems = Element (By.css ('. List ')). All (By.tagname (' Li ')); var ben = listitems.first (); var sophi = listitems.get (2), Sophi.cliick (), Expect (' class '). Sophi.getattribute (' Selected '); expect (Ben.getattribute (' class ')). Not.tomatch (' selected ');
--------------------------
In Conf.js:
var config = { suites: { './e2etest/index.spec.js ', './e2etest/ Locators.spec.js '} };
What we write into the suites are what we gonne run in the test, if we want to skip ' basics ' tests, we can does in scripts:
Protractor conf.js--chrome--suite=locators
[Protractor] Locators and Suites in Protractor