Entering text in reactjs input fields with intern leadfoot

207 views Asked by At

I'm testing a reactjs app and the type() and pressKeys() commands are not working correctly. type('string') isn't entering text into the input field and pressKeys('string') is only entering 's'. I'm not sure if this is an issue with leadfoot and react in general, or the particular react app I'm testing. Here is some sample code from the page:

<div class="Select Select--multi is-searchable" data-reactid=".0.1.0.0.1.0.0.1:$languages">
  <input type="hidden" data-reactid=".0.1.0.0.1.0.0.1:$languages.0" value="">
  <div class="Select-control" data-reactid=".0.1.0.0.1.0.0.1:$languages.1">
    <div class="Select-placeholder" data-reactid=".0.1.0.0.1.0.0.1:$languages.1.0:$placeholder">Languages</div>
    <div class="Select-input " data-reactid=".0.1.0.0.1.0.0.1:$languages.1.1" style="display:inline-block;">
      <input data-reactid=".0.1.0.0.1.0.0.1:$languages.1.1.0" style="width:5px;box-sizing:content-box;" tabindex="0" value="">
      <div data-reactid=".0.1.0.0.1.0.0.1:$languages.1.1.1" style="position: absolute; visibility: hidden; height: 0px; width: 0px; overflow: scroll; white-space: nowrap; font-size: 14.4px; font-family: "Proxima Nova","Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 400; font-style: normal; letter-spacing: normal;"></div>
    </div>
    <span class="Select-arrow-zone" data-reactid=".0.1.0.0.1.0.0.1:$languages.1.4">
  </div>
</div>

I can't select the first input element since it's hidden and I've tried selecting all of the available divs and the second input element. I currently have to do the following to enter text:

.pressKeys('t')
.pressKeys('e')
.pressKeys('x')
.pressKeys('t')

Any suggestions? I'm currently using a function that converts the data string to a char array and then enters each char one at a time.

0

There are 0 answers