【发布时间】:2020-06-12 11:38:28
【问题描述】:
我有一个使用 Web 组件的网页。我能够选择所有元素并执行断言,例如检查exists、innerText。但是,在执行click 时,它不起作用。我想知道对shadow-root 中的元素执行点击是否有任何限制?
样本
我有一个 id 为 #pricePlans 的父 div,然后我用它作为基础来选择其中的元素。您可以在下面看到我如何使用 Selector 的示例。光标甚至没有悬停在我的按钮上。
this.marathiCard = Selector(() => document.querySelector('#pricePlans').shadowRoot.querySelectorAll('[class*="grid-item"]')).nth(1);
this.marathiSignUpButton = this.marathiCard.find('[class*="c-btn c-btn--primary"]');
await t.click (this.marathiSignUpButton);
提前谢谢你
【问题讨论】:
标签: testing automation automated-tests e2e-testing testcafe