1
我試圖在嵌套中繼器中找到一個元素,但我不知道如何解決它。在量角器中找到嵌套中繼器中的元素
默認情況下,HTML看起來像以下(editted它爲便於理解)
<div ng-repeat = "Repeater1">
<div ng-repeat = "Repeater2"> Text1 </div>
<div ng-repeat = "Repeater2"> Text2 </div>
<div ng-repeat = "Repeater2"> Text3 </div>
</div>
還有就是頁面view more
,您顯示在頁面上三個項目上的按鈕。所以點擊view more
按鈕後,HTML看起來像下面如果沒有被顯示在頁面上多個項目
<div ng-repeat = "Repeater1">
<div ng-repeat = "Repeater2"> Text1 </div>
<div ng-repeat = "Repeater2"> Text2 </div>
<div ng-repeat = "Repeater2"> Text3 </div>
</div>
<div ng-repeat = "Repeater1">
<div ng-repeat = "Repeater2"> Text4 </div>
<div ng-repeat = "Repeater2"> Text5 </div>
<div ng-repeat = "Repeater2"> Text6 </div>
</div>
view more
按鈕被禁用。
所以我的問題是:從默認的頁面(點擊view more
按鈕之前)我怎樣才能找到的元素文本6?
測試應該做的:
- 搜索前三項爲
elementA
- 如果沒有找到,點擊
view more
和搜索接下來的三個項目爲elementA
- 如果沒有找到,點擊
view more
再次搜索下面三個項目elementA
以下代碼搜索機智興中繼器,但我不知道如何嵌套中繼器之間的搜索
let filteredList = this.Repeater2Elem.filter((item) => {
return item.getText().then((text) => {
return bundle === "text 2";
});
}).first().element(by.buttonText('Element Found')).click();