appfolio / ae_page_objects

Page Objects for Capybara
MIT License
28 stars 9 forks source link

Collection does not find items that are not direct children of the collection element #142

Closed dtognazzini closed 8 years ago

dtognazzini commented 8 years ago

For example, given:

<table>
<tr>
  <td class="first-name">Scooby</td>
</tr>
<tr>
  <td class="first-name">Raffy</td>
</tr>
</table>

And:

collection :rows, locator: 'table', item_locator: '.first-name'

page.rows.first.text should return "Scooby" but instead an error raised.

The error seems to be around this line: https://github.com/appfolio/ae_page_objects/blob/546d9d7efcd660ed81cabde11c8e41ac7b49a6fb/lib/ae_page_objects/elements/collection.rb#L70

dtognazzini commented 8 years ago

Closing until it can be reproduced.