Exemple #1
0
 public void testGraRozpoczeta() {
   for (int i = 0; i < 10; i++) {
     int rows = 9, columns = 9, mines = 10;
     Random rand = new Random();
     int nr = rand.nextInt(3);
     if (nr == 0) {
       rows = 9;
       columns = 9;
       mines = 10;
     }
     if (nr == 1) {
       rows = 16;
       columns = 16;
       mines = 40;
     }
     if (nr == 2) {
       rows = 30;
       columns = 16;
       mines = 99;
     }
     // tu blad wyskakuje - moze jednak zwykle klikanie
     // getActivity().ustaw(columns,rows,mines);
     // getActivity().startNewGame();
     solo.clickOnImage(0);
     solo.clickOnButton(nr);
     // po kliknieciu klawisza - czy zegar chodzi i czy miny ustawione?
     nr = rand.nextInt(columns * rows);
     solo.clickOnButton(nr);
     Assert.assertEquals(true, getActivity().isTimerstarted());
     Assert.assertEquals(true, getActivity().isAreMinesSet());
   }
 }
 private CommandResponse clickOnImag(String[] parameters) {
   String command = "the command click on image";
   CommandResponse result = new CommandResponse();
   String response = "";
   try {
     response = "attempting to click on an image button";
     solo.clickOnImage(Integer.parseInt(parameters[0]));
     result.setResponse(command + ",Response: " + response);
     result.setSucceeded(true);
   } catch (Throwable e) {
     result = handleException(command, e);
   }
   return result;
 }