当我展开包含复选框列表的复选框父级时,想要循环所有复选框以确保只选择其中的几个:
//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(按名称)是否被选中?