Closed MGaetan89 closed 3 years ago
For the changes to the tests for deprecation of ActivityTestRule in AndroidX tests mostly you have replaced a check via an API method to a test for does it exist in the Layout hierarchy.
i.e.
RelativeLayout cornerView = (RelativeLayout) tableView.getAdapter().getCornerView();
Assert.assertNotNull(cornerView);
// Check the corner view is visible
Assert.assertEquals(View.VISIBLE, cornerView.getVisibility());
with
onView(withId(R.id.corner_view))
.check(matches(not(doesNotExist())))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
So not checking the exact same thing, but I'm undecided whether this is OK or not. I guess the intent of the check was to check it was drawn and not to check the getCornerView
method.
BUT the .check(matches(not(doesNotExist())))
part is redundant as the onView
part will fail to find it in the layout if it did not exist
I note that CornerViewTest.java and SimpleActivityTest.java tests did not get converted to the onView
methodology instead of the using Api methods for consistency.
Hey, thanks for having a look.
I've started to update my changes. I'll update my PR tomorrow.
I've updated the PR in https://github.com/evrencoskun/TableView/pull/374/commits/644e08ac8ed80c6be469f89a424d27a53904e5dc to use the latest version of the dependencies.
I've updated the dependencies of the project to the latest version:
Most changes come from the deprecation of
ActivityTestRule
in AndroidX Test. I tried to adapt the code to keep the changes to a minimum.