-
Notifications
You must be signed in to change notification settings - Fork 0
Robot Pattern
Devrath edited this page Jun 29, 2021
·
5 revisions
- Consider a scenario where there is a
check-box
and we have a logic that sets itchecked/not-checked
based on logic. - Now if we change the
check-box
to aimage-view
then a lot of things need to be modified.
- By separating
what
and thehow
our tests are moremaintainable
. - In above example,
-
What
-> whether the checkbox needs to be checked. -
How
-> whether the widget is checked.
-
- This pattern exposes an API that separates what and the how.
- Test cases are more readable.
- The entire logic is encapsulated in a separate place, so if the UI changes then we just need to modify the test case in one place.