I saw a couple of solutions in the original webdriver that use getAttribute ('xpath') and add '/ ..' to this, but webdriver.io does not have an xpath attribute, so I could not use this. Any ideas on how to capture the parent?
The case I'm trying to test is inside the bootstrap layout, and the element that actually gets the class I'm trying to test is the one above. It looks like this:
<div class="form-group">
<input class="form-control" type="text" name="username">
<other stuff>
</div>
I select driver.element ("input [name = 'username'"], but the error class actually falls into the div
<div class="form-group error">
<input class="form-control" type="text" name="username">
<other stuff>
</div>
So, I need to check if the div class has an error class and not the input that I can find (there are no uniques in the div)
Any help would be greatly appreciated.