mardi 21 janvier 2020

Working with checkboxes - unable to check if checkboxes are disabled

Looking for some review on this to let me know if this is the right approach to check for disabled checkboxes.

Part of my page model here:

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")
      ];

Part of my test here

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

Getting error such as:

ReferenceError: label is not defined

Aucun commentaire:

Enregistrer un commentaire