background image

  

//Delete Note 1 test

  

solo.clickOnMenuItem("Delete");

  

//Note 1 test & Note 2 should not be found

  

boolean expected = false;

  

boolean actual = solo.searchText("Note 1 test");

  

//Assert that Note 1 test is not found

  

assertEquals("Note 1 Test is found", expected, actual);
solo.clickLongOnText("Note 2");
//Clicks on Delete in the context menu
  

solo.clickOnText("(?i).*?Delete.*");

  

actual = solo.searchText("Note 2");

  

//Assert that Note 2 is not found

  

assertEquals("Note 2 is found", expected, actual);

  

}

  

@Override

  

public void tearDown() throws Exception {

  

try {

  

//Robotium will finish all the activities that have been opened

  

solo.finalize();

  

} catch (Throwable e) {

  

e.printStackTrace();

  

}

  

getActivity().finish();

  

super.tearDown();

  

}

  

}