查看一些客户信息时,我看到底部显示了客户信息.我相信它来自JSON调用.
如何识别这个元素?我尝试了className,但无法正常工作.谢谢你的帮助.并尝试了此CSS. .override-info隐藏移动ng-scope.我需要断言与John Grish匹配的名称:
<div class="override-info hide-mobile ng-scope" ng-if="overrideCustInfo">
<p class="override-info-title">You are viewing</p>
<p class="override-info-dtl ng-binding">John Grish</p>
<p class="override-info-dtl ng-binding">1177 Montogomery st</p>
<p class="override-info-dtl ng-binding">San Francisco, CA</p>
</div>
解决方法:
您可以依靠类名:
expect(element
.all(by.css("div.override-info p.override-info-dtl"))
.first().getText()
).toEqual("John Grish");