小编Woo*_*oof的帖子

cypress如何检查子复选框是否被选中

当我展开包含复选框列表的复选框父级时,想要循环所有复选框以确保只选择其中的几个:

//expand parent
// select checkbox1
cy.get('[aria-label="checkbox1"]').check({ force: true });
// select checkbox 5
cy.get('[aria-label="checkbox5"]').check({ force: true });

//close then expand again 
Run Code Online (Sandbox Code Playgroud)

问题:如何轻松循环父级下的所有复选框以仅检查 checkbox1 和 5(按名称)是否被选中?

checkbox cypress

0
推荐指数
1
解决办法
349
查看次数

标签 统计

checkbox ×1

cypress ×1