黄瓜水豚测试突出显示文本

use*_*109 5 selenium xpath cucumber capybara web

我将 Cucumber 与 Capybara 和 Selenium 一起使用,我正在尝试在支持文本高亮后定义和添加注释等功能的文档阅读器上编写测试。我的第一个想法是使用 xpath 找到元素并双击它,我使用的 xpath is page.find(:xpath, "//text()[contains(.,'Monday')]"),这将选择整个句子包含 Monday,我如何只突出显示 ' Monday'?任何人的帮助都会非常感激

我的 html 看起来像这样:

<p>This is test
    <br>
    "Today is Monday"
    <br>
    "Today is Tuesday"
</p>
Run Code Online (Sandbox Code Playgroud)