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
Post a Comment