使用复选框 - 无法检查复选框是否被禁用

安佳娜

寻找关于此的一些评论,让我知道这是否是检查禁用复选框的正确方法。

我的页面模型的一部分:

class eligibleAccountType {
  constructor (text) {
      this.label    = label.withText(text);
      this.checkbox = this.label.find('input[type=checkbox]');
  }
}

class ProgramOptionsSubscriptionRulesPage{
    constructor(){
        this.contractsatAccountLevel = Selector("#program_option_allow_participant_account_contracts")
        this.eligibleAccountTypesList = [
          new eligibleAccountType("Residential"),
          new eligibleAccountType("Commercial"),
          new eligibleAccountType("Industrial")
      ];

我在这里测试的一部分

if (userdata.userrole == "Read Only") {
 
 for (const eligibleAccountType of programOptionsSubscriptionRulesPage.eligibleAccountTypeList) {
            await t.expect(eligibleAccountType.hasAttribute('disabled')).ok()
          }
        }

获取错误,例如:

ReferenceError: label is not defined
安佳娜

我想我发现了问题,我还没有定义

const label = Selector('label');

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章