Auto-tools/Projects/Robocop/WritingTests: Difference between revisions

Line 12: Line 12:
= APIs  =
= APIs  =


The two main interfaces that are used are Driver and Element. Driver finds elements, and has a direct relation to the Gecko. Element represents each of the available UI objects in Fennec including the Awesomebar, the 'tabs' button, and different lists and menus.
The three main interfaces that are used are Actions, Driver and Element. Driver finds elements, and has a direct relation to the Gecko to set up the . Element represents each of the available UI objects in Fennec including the Awesomebar, the 'tabs' button, and different lists and menus. Actions has a list of commonly used non-element specific actions that can be taken on the application, such as dragging and sending keys.
 
<pre>
Actions
  //This will cause this process to spin until the gecko fires a specific JSON event, such as DOMContentLoaded
  void waitForGeckoEvent(String geckoEvent);
  //Clicks the given Key (Element.SpecialKey.[DOWN|UP|LEFT|RIGHT|ENTER])
  void clickSpecialKey(SpecialKey button)
  //Sends a string of characters to the system. (most have been implemented but not all)
  void sendKeys(String keysToSend);
  //Sends a drag action across the screen
  void drag(int startingX, int endingX, int startingY, int endingY)
</pre>
 
<pre>
<pre>
Driver
Driver
Line 36: Line 49:
   //To click the element.
   //To click the element.
   void click()
   void click()
  //Clicks the given Key (Element.SpecialKey.[DOWN|UP|LEFT|RIGHT|ENTER])
  void clickSpecialKey(SpecialKey button)
  //Sends a string of characters to the system. (most have been implemented but not all)
  void sendKeys(String keysToSend);
   //Returns true if the element is currently displayed
   //Returns true if the element is currently displayed
   boolean isDisplayed();
   boolean isDisplayed();
62

edits