In your case I'd try using MutationObserver to observer(<yourDayPickerElement>), loop through addedNodes to find a node that has "March" textContent for example.
I believe in Cypress you can setup & run the observe with cy.window().then(() => { new MutationObserver... }), then once the "March" text is found you can call cy.click on so on.
A more simpler approach would be using wait & expect(<yourDayPicker>).<toHaveMatchText...>, but it's less accurate and can sometimes fail if you're unsure how to expect for that "March" text.
发布评论
评论(2)
在您的情况下,我会尝试使用 mutationObserver > observer(&lt; yourdaypickerelement&gt;),通过
添加nodes
循环以找到一个具有“ March” TextContent的节点。我相信您可以设置&amp;使用
cy.window()。然后(()=&gt; {new MutationObserver ...})
,然后找到“三月”文本,您可以调用cy。单击
以便打开。一种更简单的方法是使用
等待
&amp;期望(&lt; YourDayPicker&gt;)。
In your case I'd try using MutationObserver to
observer(<yourDayPickerElement>)
, loop throughaddedNodes
to find a node that has "March" textContent for example.I believe in Cypress you can setup & run the observe with
cy.window().then(() => { new MutationObserver... })
, then once the "March" text is found you can callcy.click
on so on.A more simpler approach would be using
wait
&expect(<yourDayPicker>).<toHaveMatchText...>
, but it's less accurate and can sometimes fail if you're unsure how to expect for that "March" text.没有代码很难正确回答,但可能是类似的:
With no code is hard to answer properly but could be something similar: