clicking toggle switches in nightwatch...

358 views
Skip to first unread message

OliverB

unread,
Feb 8, 2016, 4:10:03 PM2/8/16
to NightwatchJs
I wrote a few tests with nightwatch that look like this:

'Test Toggles': function (client) {
            client
                .assert.attributeEquals("#enableEmptyString", "value", "false")
                .click("#enableEmptyString").pause(100)
                .assert.attributeEquals("#enableEmptyString", "value", "true")
}

The toggles look like this:

<div class="checkbox checkbox-slider-primary checkbox-slider checkbox-slider--b checkbox-slider-md">
    <label>
        <input class="toggleBoolean" id="enableEmptyString" type="checkbox" name="configurationProperties.enableEmptyString" value="false">
        <span></span>
    </label>
</div>

These work fine when I use the default client (firefox) but if I switch to Chrome the toggles are not clicked.  What is a better way to do this that is client agnostic?

Derrick Schmidt

unread,
Apr 13, 2016, 12:18:30 PM4/13/16
to NightwatchJs
What version of Chrome are you using? We have run into issues with earlier versions of Chrome (v43.X) not properly clicking elements.
Reply all
Reply to author
Forward
0 new messages