theappbusiness / TABTestKit

Library designed to make writing and maintaining automated tests for iOS applications. This includes automation of bio-metrics and controlling of mock servers
MIT License
59 stars 13 forks source link

Issue53/assertion for element label #112

Closed annapiktas closed 4 years ago

annapiktas commented 4 years ago

https://github.com/theappbusiness/TABTestKit/issues/53 Assertion of the label was added to Interaction Context. A few statements using the new label func were added to the existing tests.

SamDKBerry commented 4 years ago

This adds the functionality on the issue and tests it well 👍

@KaneCheshire do we really want that functionality? I think it muddies what ValueRepresentable provides. Currently I can assert the value of an element without needing to worry where that value comes from - it could be the raw elements label, value or some other piece of logic. If I want to assert on an element I always know which function to use.

If there isn't an existing element that meets my needs I can always add a custom one.

If we make this change I'm going to start having the option of asserting value or label - some of the time they'll do exactly the same thing. Are there many cases where the ValueRepresentable isn't a label and you want to check the label? If so might we want the ability to check if one of multiple fields matches the string passed .e.g check if it matches the underlying value or label?

KaneCheshire commented 4 years ago

Well, sometimes the value is different from the label, so how would you assert the label in a test if the value is a number?

SamDKBerry commented 4 years ago

I hadn't considered you might care about both and therefore an additional element wouldn't fix your problem. 👍