Пример #1
0
 /**
  * checks if the button with input text is visble
  *
  * @param buttonText the text of the button
  * @return response with the status of the command
  * @throws Exception
  */
 private boolean isButtonVisibleByText(String buttonText) throws Exception {
   Button button = this.solo.getButton(buttonText);
   if (button != null) {
     return button.isShown();
   } else {
     throw new Exception("Button with text: " + buttonText + " was not found");
   }
 }
Пример #2
0
 /**
  * checks if the button with input id is visible
  *
  * @param buttonId the id of the button
  * @return response with the status of the command
  * @throws Exception
  */
 private boolean isButtonVisibleById(int buttonId) throws Exception {
   ArrayList<Button> currentButtons = this.solo.getCurrentViews(Button.class);
   for (Button button : currentButtons) {
     if (button.getId() == buttonId) {
       if (button.isShown()) {
         return true;
       }
     }
   }
   return false;
 }