【发布时间】:2021-11-11 08:24:27
【问题描述】:
我需要一些帮助才能使用 Playwright 测试制作条件语句。
我有一个给定的选择器,比如说一个按钮,我需要写一个这样的条件语句:
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*
有没有什么有效的方法来做这些事情?我在 Playwright 文档中没有找到任何内容。
【问题讨论】:
标签: javascript typescript testing automated-tests playwright