iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
89.81k stars 26.57k forks source link

Robot pattern #606

Open mibac138 opened 7 years ago

mibac138 commented 7 years ago

Description: The Robot design pattern is an advanced testing pattern commonly used in Android development to simplify and streamline UI testing. The core idea is to encapsulate the interactions with the UI components in a separate class, referred to as a "Robot," which then exposes high-level methods for test scripts to use. This promotes clean, readable, and maintainable test code by abstracting away the detailed interactions with the UI.

Main elements of the pattern:

  1. Robot Class: This class handles UI interactions. It encapsulates the operations that can be performed on the UI, such as clicking buttons, entering text, or verifying text visibility.
  2. Test Class: This class uses the Robot class to perform tests. It calls the high-level methods provided by the Robot class, making the test code cleaner and more readable.
  3. Fluent Interface: The Robot methods are often designed to return the Robot itself, enabling method chaining for more concise and expressive tests.

References:

  1. Robot Design Pattern Overview
  2. Java Design Patterns Contribution Guidelines

Acceptance Criteria:

  1. A Robot class is implemented encapsulating UI interactions.
  2. A sample test class is provided demonstrating the use of the Robot class.
  3. Documentation is updated to include a description of the Robot design pattern and usage examples.
kiratalreja3 commented 2 years ago

Hi, can I work on this issue? Thanks! @mibac138

iluwatar commented 2 years ago

Ok @kiratalreja3

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.