appfolio / ae_page_objects

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

qc/ch - add selected text method for select element #115

Closed choruk closed 8 years ago

dtognazzini commented 9 years ago

Please add tests.

dtognazzini commented 8 years ago

No progress on this for many months. Closing. Feel free to reopen with fixes.

choruk commented 7 years ago

I guess we never posted any follow up after we looked into this further, so I will do that now (better late than never :wink:). This PR was abandoned because the selected html attribute only indicates initial selection when the page loads. If the select element is interacted with after the page loads, the item that had the selected html attribute will still have it and this will not return the text of the option that is actually selected.

One alternative that could be pursued involves using the :selected pseudo selector (provided by jQuery). However, our needs were satisfied by simply checking that the select has the correct value selected (by calling the value method on the select element).