Nightwatch: Assert for element disabled

Created on 14 Nov 2014  路  2Comments  路  Source: nightwatchjs/nightwatch

Hi,

I'm trying to test for the state of the disabled attribute on an input.

.assert.attributeEquals('.an-input-classname', 'disabled', true) - this works
.assert.attributeEquals('.an-input-classname', 'disabled', false) - this doesn't work

This appears to be because the attribute is not present when the input is not disabled

Please advice if my approach is wrong, or is this a feature that can be requested.

Thanks

Darren

Most helpful comment

A solution to this could be:

.getAttribute('.an-input-classname', 'disabled', function(result) {this.assert.equal(result.value, null);})

All 2 comments

A solution to this could be:

.getAttribute('.an-input-classname', 'disabled', function(result) {this.assert.equal(result.value, null);})

This doesn't appear to be a problem caused by Nightwatch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dakebl picture dakebl  路  4Comments

gary5 picture gary5  路  4Comments

chaseconey picture chaseconey  路  4Comments

davidlinse picture davidlinse  路  4Comments

danielbentov picture danielbentov  路  4Comments