我需要一些帮助来使用剧作家测试做出条件语句。
我有一个给定的选择器,比如说一个按钮,我需要编写如下的条件语句:
if (selector is not present/visible)
do nothing and proceed with the *next lines of code*
else
await page.click(*selector*)
*next lines of code*
Run Code Online (Sandbox Code Playgroud)
有没有有效的方法来做这些事情?我在剧作家文档中没有找到任何内容。