angularjs - Protractor test for Angular: how to get exact match for column name -


i have started writing protractor tests, beginner this.

i have following angular code trying test:

<tr ng-repeat="identifier in contentidentifiers">     <td>{{identifier.contentidentifier}}</td>     <td>{{identifier.contentidentifiertypedescription}}</td>     <td>{{identifier.licensedwebsiteidentifier}}</td> </tr> 

where content identifier has following values:

contentidentifiers = [     {         contentidentifier: '123-123-1-abc',         contentidentifiertypedescription: 'doi',         licensedwebsiteidentifier: 'test website'     },     {         contentidentifier: 'abc-def',         contentidentifiertypedescription: 'isbn',         licensedwebsiteidentifier: 'test website'     }, ]; 

and relevant protractor snippet:

var identifier = element.all(by.repeater("identifier in contentidentifiers").column("identifier.contentidentifier")); expect(identifier.get(0).gettext()).toequal("123-123-1-abc"); expect(identifier.get(1).gettext()).toequal("abc-def"); 

for error: expected 'doi' equal 'abc-def'.

if change to:

expect(identifier.get(2).gettext()).toequal("abc-def"); 

then passes.

from think issue column("identifier.contentidentifier") matches 'contentidentifiertypedescription'.

this data comes server, , cannot change sake of test. hence solution list of desired column only. options exact column name match?

this done using by.exactrepeater finder. sounds bit weird modifies subsequent column method behaviour it does.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -