Correct way to get a count of matching elements in Nightwatch?
I found the following very elegant solution within a VueJS template. It shows how to add a custom assertion into Nightwatch that counts the number of elements returned by a selector. See http://nightwatchjs.org/guide#writing-custom-assertions for details of how to write custom assertions within Nightwatch. Once installed, usage is as simple as: browser.assert.elementCount(‘#todo-list li’, 2) The plugin: … Read more