问题描述
我在页面上有一个文本,我必须验证该文本是否存在。元素的 html 是 <p class="subfooter__text" data-v-79ab1348=""> The Tesla is part of the <a href="//www.xyz.com/" target="_blank" rel="noopener nofollow">Automobile</a> publishing family.</p>
需要验证的文字是“特斯拉是汽车出版家族的一部分”。问题是,断言在为全文断言时失败,但在为“汽车”或“出版系列”或“汽车出版系列”断言时确实通过。断言永远不会传递给 href 标记之前的文本。
这是代码部分 browser.assert.containsText('p.subfooter__text','The Tesla is part of the Automobile publishing family');
我确保所有空格都得到了照顾。
非常感谢任何帮助。