2017-10-08 114 views
0
<md-tab *ngFor="let course of profCourses> 
    <div class="wrapper"> 
     <!--some html--> 
    </div> 
</md-tab> 

我想從量角器設置profCourses和測試內部HTML的功能。如何設置量角器的這種綁定?如何設置量角器的中繼器?

是它像

element.all(by.repeater('let course of profCourses')).then(function (courses) { 
     courses[0].sendKeys('Course 1'); 
     courses[1].sendKeys('Course 2'); 
     courses[2].sendKeys('Course 3'); 
    }); 

我收到錯誤上面爲「未定義無法讀取屬性‘的SendKeys’」

PS:我用的角4.0

+1

ng-repeater將無法使用角度版本2和4.請參閱https://github.com/an gular /量角器/問題/ 3205。 –

回答

0

正確的代碼將是

courses.get(0).sendKeys('Course 1'); 
    courses.get(1).sendKeys('Course 2'); 
    courses.get(2).sendKeys('Course 3'); 
相關問題