Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,22 @@ class AboutDialogTest {
Espresso.onView(ViewMatchers.withText(R.string.dialog_about_catrobat_link_text))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))

val versionCode =
if (BuildConfig.FLAVOR == "pocketCodeBeta") "-${BuildConfig.VERSION_CODE}" else ""
val expectedVersionName = baseActivityTestRule.activity.getString(R.string.app_name) +
versionCode + " " +
baseActivityTestRule.activity.getString(R.string.dialog_about_version) + " " +
baseActivityTestRule.activity.getString(R.string.android_version_prefix) +
Utils.getVersionName(ApplicationProvider.getApplicationContext())
val expectedCatrobatVersionName =
baseActivityTestRule.activity.getString(R.string.dialog_about_catrobat_language_version) +
": " + Constants.CURRENT_CATROBAT_LANGUAGE_VERSION

Espresso.onView(ViewMatchers.withId(R.id.dialog_about_text_view_version_name))
.check(ViewAssertions.matches(ViewMatchers.withText(expectedVersionName)))

Espresso.onView(ViewMatchers.withId(R.id.dialog_about_text_view_catrobat_version_name))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
.check(ViewAssertions.matches(ViewMatchers.withText(expectedCatrobatVersionName)))

Assert.assertNotNull(Utils.getVersionName(ApplicationProvider.getApplicationContext()))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AboutDialogFragment : DialogFragment() {
Html.fromHtml(aboutCatrobatUrl)
}

val aboutVersionNameTextView = binding.dialogAboutTextViewCatrobatVersionName
val aboutVersionNameTextView = binding.dialogAboutTextViewVersionName
val versionCode =
if (BuildConfig.FLAVOR == "pocketCodeBeta") "-" + BuildConfig.VERSION_CODE else ""
val versionName =
Expand Down
Loading