private void createSingleHire() { ActivityUtils.fromActivityToActivity(MainActivity.class, Hire.class); // add one customer request CustomerRequest customerRequest = AutoAction.autoHire(); AutoAction.goToActivity(ServiceProviderListByServiceID.class, CustomerRequestList.class); onView( allOf( withText(R.string.strEnter), hasSibling(withText(customerRequest.getDescription())))) .perform(click()); AutoAction.goToActivity(ServiceProviderListByServiceID.class, Hire.class); }
private void createMultipleHire() { // add a few customer request List<CustomerRequest> customerRequestList = AutoAction.autoHireList(); // check all the customer request is created by same person AutoAction.goToActivity(Hire.class, CustomerRequestList.class); for (CustomerRequest customerRequestRec : customerRequestList) { onView( allOf( ViewMatchers.withText(R.string.strEnter), hasSibling(withText(customerRequestRec.getDescription())))) .perform(click()); AutoAction.goToActivity(ServiceProviderListByServiceID.class, CustomerRequestList.class); } }