javascript - NightwatchJS: How to check if attribute is not present? -


i want check if disabled attribute not present on button using nightwatchjs.

i tried doing these:

  • .assert.attributecontains('.phone-verify-btn', 'disabled', 'null')

  • .assert.attributecontains('.phone-verify-btn', 'disabled', null)

  • .assert.attributecontains('.phone-verify-btn', 'disabled', 'false')

  • .assert.attributecontains('.phone-verify-btn', 'disabled', false)

but these don't seem work check if disabled set true so:

  • .assert.attributecontains('.phone-verify-btn', 'disabled', 'true')

this works fine! idea what's happening here? error rather cryptic:

element not have disabled attribute. - expected "null" got: null

in case,i think should attribute first until have better solution. 1 works me :

 browser.getattribute('@element','disabled',function(result){    if(result.value === 'true'){       // element disabled , want    }    // element not disabled .   }) 

perhaps not logical !


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -