You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/06 09:09:31 UTC
[GitHub] [cordova-android] raphinesse commented on a change in pull request #1038: Removed duplicate code in test
raphinesse commented on a change in pull request #1038:
URL: https://github.com/apache/cordova-android/pull/1038#discussion_r500122135
##########
File path: test/android/app/src/androidTest/java/org/apache/cordova/unittests/BackButtonMultipageTest.java
##########
@@ -140,19 +142,28 @@ public void testViaBackButtonOnView() throws Throwable {
mActivityRule.runOnUiThread(new Runnable() {
public void run() {
- webInterface.loadUrl("file:///android_asset/www/backbuttonmultipage/sample2.html");
+ webInterface.loadUrl(SAMPLE2_URL);
}
});
- assertEquals("file:///android_asset/www/backbuttonmultipage/sample2.html", mActivity.onPageFinishedUrl.take());
+ assertPageSample2();
mActivityRule.runOnUiThread(new Runnable() {
public void run() {
- webInterface.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
+ webInterface.loadUrl(SAMPLE3_URL);
}
});
- assertEquals("file:///android_asset/www/backbuttonmultipage/sample3.html", mActivity.onPageFinishedUrl.take());
+ assertPageSample3();
onView(withId(WEBVIEW_ID)).perform(pressBack());
- assertEquals("file:///android_asset/www/backbuttonmultipage/sample2.html", mActivity.onPageFinishedUrl.take());
+ assertPageSample2();
onView(withId(WEBVIEW_ID)).perform(pressBack());
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
}
+
+ private void assertPageSample3() {
Review comment:
I would prefer having a single helper `assertOnPage(String url)` and then calling it with `SAMPLE2_URL` and `SAMPLE3_URL`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org