theextremeprogrammer / Succinct

UI tests at the speed of unit tests. Proper encapsulation. Architecture agnostic. Freedom to refactor.
MIT License
42 stars 7 forks source link

Check SegmentControl segment titles #57

Open XuqiuyeLi opened 4 years ago

XuqiuyeLi commented 4 years ago

Succinct allows you check selected segment title. Is there a way to check unselected ones?

theextremeprogrammer commented 4 years ago

Looks like we don't support that yet - but there are some test samples for searching for selected segments. Would you like to give this a try and make a PR? =)

theextremeprogrammer commented 4 years ago

Here are some references that might help:

Let me know if you have any questions. Thanks!

rgravina commented 3 years ago

Thanks for making this issue @XuqiuyeLi ! I was using hasLabel and wondering why it wasn't finding the segment titles. Didn't know about hasSegmentedControlSegmentSelected!

I think through a combination of hasSegmentedControlSegmentSelected and selectSegment you might not need to look for unselected segments, but it depends on your app. If the segments are hardcoded then I guess there's no need to check they exist. But, there are possible use cases, like if your segments are dynamically generated.