Finding a parent element in webdriver.io
<p>I've seen a couple of solutions in the original webdriver that use getAttribute('xpath') and append to that '/..' but webdriver.io doesn't have an xpath attribute so I haven't been able to use that. Any ideas on how to grab the parent element?</p>

<p>The case I am trying to test is inside of a bootstrap layout and the element that is actually getting the class I am trying to check is one above. It looks like this:</p>

<pre><code>&lt;div class="form-group"&gt;
  &lt;input class="form-control" type="text" name="username"&gt;
  &lt;other stuff&gt;
&lt;/div&gt;
</code></pre>

<p>I am selecting by driver.element("input[name='username'"] but the error class actually hits the div</p>

<pre><code>&lt;div class="form-group error"&gt;
  &lt;input class="form-control" type="text" name="username"&gt;
  &lt;other stuff&gt;
&lt;/div&gt;
</code></pre>

<p>So I need to check if the div itself has an error class, not the input I can find (there are no uniques on the div)</p>

<p>Any help would be greatly appreciated.</p>