确定是否在量角器测试中显示占位符文本

Determine if placeholder text is displayed in protractor test

如何检查以确定占位符文本是否实际显示在量角器测试中的输入字段中?

使用以下方法我可以检查显示的占位符文本,但 returns 它是否实际显示:

this.groupName.getAttribute( 'placeholder' )

这是一个范围问题,您的浏览器知道如何处理。 您不应测试浏览器解释和显示占位符的能力。检查是否设置了所需的 placeholder 属性值就足够了。

不过,您可以 test if your browser supports placeholder attribute