Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix images not shown in screenshots (DEV) #3318

Merged
merged 44 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ffd6809
Fix images not shown in Screenshots
LukasLechnerDev May 28, 2021
fb94fb4
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
LukasLechnerDev May 28, 2021
5a0f992
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
mtwalli May 31, 2021
789d4dc
Run firebase_screenshots in CI pipeline
LukasLechnerDev May 31, 2021
4eb5b8c
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
mtwalli May 31, 2021
5b04e72
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
mtwalli May 31, 2021
1a46ce1
Use ImageView instead of AppCompatImageView
LukasLechnerDev May 31, 2021
a6b2931
Merge remote-tracking branch 'origin/dev/fix-images-not-shown-in-scre…
LukasLechnerDev May 31, 2021
680a0a6
Use launchFragmentInContainer2
mtwalli May 31, 2021
44837b6
Revert to use launchFragmentInContainer2
mtwalli May 31, 2021
aa25162
fix imports
mtwalli May 31, 2021
ae3f904
Update activity_fake_empty.xml
mtwalli May 31, 2021
bfa63aa
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
mtwalli May 31, 2021
2374baa
Fix tests
mtwalli May 31, 2021
76e886b
Merge branch 'dev/fix-images-not-shown-in-screenshots' of https://git…
mtwalli May 31, 2021
9a44aae
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
mtwalli May 31, 2021
ec527cf
Update TraceLocationCreateFragmentTest.kt
mtwalli May 31, 2021
15c5250
Fix tests 2
mtwalli May 31, 2021
0bbb915
Fix TraceLocationCreateFragmentTest
mtwalli May 31, 2021
27e71bf
now?
mtwalli May 31, 2021
e12f546
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
mtwalli May 31, 2021
fdb7b7b
Try another Device
mtwalli May 31, 2021
62f62dc
Revert "Try another Device"
mtwalli May 31, 2021
648981c
Revert
mtwalli Jun 1, 2021
4962d44
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
mtwalli Jun 1, 2021
623ea10
Merge branch 'release/2.3.x' into dev/fix-images-not-shown-in-screens…
harambasicluka Jun 1, 2021
6d28e1b
Fix images not shown in Screenshots
LukasLechnerDev May 28, 2021
8d7d5a0
Run firebase_screenshots in CI pipeline
LukasLechnerDev May 31, 2021
457be55
Use ImageView instead of AppCompatImageView
LukasLechnerDev May 31, 2021
250e4c2
Use launchFragmentInContainer2
mtwalli May 31, 2021
60ada5b
Revert to use launchFragmentInContainer2
mtwalli May 31, 2021
94a3884
fix imports
mtwalli May 31, 2021
fd7118b
Update activity_fake_empty.xml
mtwalli May 31, 2021
d405ceb
Fix tests
mtwalli May 31, 2021
da24bc1
Update TraceLocationCreateFragmentTest.kt
mtwalli May 31, 2021
ed11048
Fix tests 2
mtwalli May 31, 2021
df1d497
Fix TraceLocationCreateFragmentTest
mtwalli May 31, 2021
9b927d4
now?
mtwalli May 31, 2021
ae173e8
Try another Device
mtwalli May 31, 2021
d372fd0
Revert "Try another Device"
mtwalli May 31, 2021
43c54d9
Revert
mtwalli Jun 1, 2021
6e8f4d8
Merge branch 'dev/fix-images-not-shown-in-screenshots' of https://git…
mtwalli Jun 2, 2021
84836e7
Fix imports
mtwalli Jun 2, 2021
32e4e30
Merge branch 'release/2.4.x' into dev/fix-images-not-shown-in-screens…
mtwalli Jun 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.rki.coronawarnapp.ui.eventregistration.organizer

import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.navigation.Navigation
import androidx.navigation.testing.TestNavHostController
import androidx.test.core.app.ApplicationProvider
Expand Down Expand Up @@ -30,7 +31,6 @@ import org.junit.Test
import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.TestDispatcherProvider
import testhelpers.launchFragmentInContainer2
import java.util.TimeZone

@RunWith(AndroidJUnit4::class)
Expand Down Expand Up @@ -71,7 +71,8 @@ class TraceLocationCreateFragmentTest : BaseUITest() {

@Test
fun duplicateEventWithSameDatesTest() {
launchFragmentInContainer2<TraceLocationCreateFragment>(
launchFragmentInContainer<TraceLocationCreateFragment>(
themeResId = R.style.AppTheme_Main,
fragmentArgs = TraceLocationCreateFragmentArgs(
category = TraceLocationData.categoryEvent,
originalItem = TraceLocationData.traceLocationSameDate
Expand All @@ -90,7 +91,8 @@ class TraceLocationCreateFragmentTest : BaseUITest() {

@Test
fun duplicateEventWithDifferentDatesTest() {
launchFragmentInContainer2<TraceLocationCreateFragment>(
launchFragmentInContainer<TraceLocationCreateFragment>(
themeResId = R.style.AppTheme_Main,
fragmentArgs = TraceLocationCreateFragmentArgs(
category = TraceLocationData.categoryEvent,
originalItem = TraceLocationData.traceLocationDifferentDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragment2
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class OnboardingAnalyticsFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -83,7 +84,8 @@ class OnboardingAnalyticsFragmentTest : BaseUITest() {
@Screenshot
@Test
fun capture_screenshot() {
captureScreenshot<OnboardingAnalyticsFragment>()
launchFragmentInContainer2<OnboardingAnalyticsFragment>()
takeScreenshot<OnboardingAnalyticsFragment>()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ import org.junit.Test
import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.captureScreenshot
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class StatisticsExplanationFragmentTest : BaseUITest() {

@Screenshot
@Test
fun capture_screenshot() {
captureScreenshot<StatisticsExplanationFragment>()
launchFragmentInContainer2<StatisticsExplanationFragment>()
takeScreenshot<StatisticsExplanationFragment>()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class SubmissionConsentFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -66,9 +67,8 @@ class SubmissionConsentFragmentTest : BaseUITest() {
@Test
@Screenshot
fun capture_fragment_results() {
captureScreenshot<SubmissionConsentFragment>(
fragmentArgs = fragmentArgs
)
launchFragmentInContainer2<SubmissionConsentFragment>(fragmentArgs = fragmentArgs)
takeScreenshot<SubmissionConsentFragment>()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.rki.coronawarnapp.ui.submission

import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.navigation.Navigation
import androidx.navigation.testing.TestNavHostController
import androidx.test.core.app.ApplicationProvider
Expand All @@ -20,9 +21,9 @@ import org.junit.Test
import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.captureScreenshot
import testhelpers.launchFragment2
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class SubmissionContactFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -53,9 +54,10 @@ class SubmissionContactFragmentTest : BaseUITest() {
fun testContactEnterTanClicked() {
val navController = TestNavHostController(ApplicationProvider.getApplicationContext())
runOnUiThread { navController.setGraph(R.navigation.nav_graph) }
launchFragmentInContainer2<SubmissionContactFragment>().onFragment { fragment ->
Navigation.setViewNavController(fragment.requireView(), navController)
}
launchFragmentInContainer<SubmissionContactFragment>(themeResId = R.style.AppTheme_Main)
.onFragment { fragment ->
Navigation.setViewNavController(fragment.requireView(), navController)
}

onView(withId(R.id.submission_contact_button_enter))
.perform(click())
Expand All @@ -64,7 +66,8 @@ class SubmissionContactFragmentTest : BaseUITest() {
@Test
@Screenshot
fun capture_fragment() {
captureScreenshot<SubmissionContactFragment>()
launchFragmentInContainer2<SubmissionContactFragment>()
takeScreenshot<SubmissionContactFragment>()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.rki.coronawarnapp.ui.submission

import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.navigation.Navigation
import androidx.navigation.testing.TestNavHostController
import androidx.test.core.app.ApplicationProvider
Expand All @@ -25,7 +26,6 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragment2
import testhelpers.launchFragmentInContainer2
import testhelpers.preferences.mockFlowPreference
Expand Down Expand Up @@ -70,29 +70,32 @@ class SubmissionDispatcherFragmentTest : BaseUITest() {

@Test
fun testEventQRClicked() {
launchFragmentInContainer2<SubmissionDispatcherFragment>().onFragment {
Navigation.setViewNavController(it.requireView(), navController)
}
launchFragmentInContainer<SubmissionDispatcherFragment>(themeResId = R.style.AppTheme_Main)
.onFragment {
Navigation.setViewNavController(it.requireView(), navController)
}
onView(withId(R.id.submission_dispatcher_qr))
.perform(scrollTo())
.perform(click())
}

@Test
fun testEventTeleClicked() {
launchFragmentInContainer2<SubmissionDispatcherFragment>().onFragment {
Navigation.setViewNavController(it.requireView(), navController)
}
launchFragmentInContainer<SubmissionDispatcherFragment>(themeResId = R.style.AppTheme_Main)
.onFragment {
Navigation.setViewNavController(it.requireView(), navController)
}
onView(withId(R.id.submission_dispatcher_tan_tele))
.perform(scrollTo())
.perform(click())
}

@Test
fun testEventTanClicked() {
launchFragmentInContainer2<SubmissionDispatcherFragment>().onFragment {
Navigation.setViewNavController(it.requireView(), navController)
}
launchFragmentInContainer<SubmissionDispatcherFragment>(themeResId = R.style.AppTheme_Main)
.onFragment {
Navigation.setViewNavController(it.requireView(), navController)
}
onView(withId(R.id.submission_dispatcher_tan_code))
.perform(scrollTo())
.perform(click())
Expand All @@ -101,7 +104,9 @@ class SubmissionDispatcherFragmentTest : BaseUITest() {
@Test
@Screenshot
fun capture_fragment() {
captureScreenshot<SubmissionDispatcherFragment>()
launchFragmentInContainer2<SubmissionDispatcherFragment>()
takeScreenshot<SubmissionDispatcherFragment>()

onView(withId(R.id.submission_dispatcher_tan_tele))
.perform(scrollTo())
takeScreenshot<SubmissionDispatcherFragment>("2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
Expand Down Expand Up @@ -73,13 +73,15 @@ class SubmissionSymptomCalendarFragmentTest : BaseUITest() {
@Test
@Screenshot
fun capture_fragment() {
captureScreenshot<SubmissionSymptomCalendarFragment>(
launchFragmentInContainer2<SubmissionSymptomCalendarFragment>(
fragmentArgs = SubmissionSymptomCalendarFragmentArgs(
Symptoms.Indication.POSITIVE,
CoronaTest.Type.PCR
).toBundle()
)

takeScreenshot<SubmissionSymptomCalendarFragment>()

onView(withId(R.id.target_button_verify))
.perform(scrollTo())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragment2
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot
Expand Down Expand Up @@ -92,11 +91,12 @@ class SubmissionSymptomIntroFragmentTest : BaseUITest() {
@Test
@Screenshot
fun capture_fragment() {
captureScreenshot<SubmissionSymptomIntroductionFragment>(
launchFragmentInContainer2<SubmissionSymptomIntroductionFragment>(
fragmentArgs = SubmissionSymptomIntroductionFragmentArgs(
CoronaTest.Type.PCR
).toBundle()
)
takeScreenshot<SubmissionSymptomIntroductionFragment>()
onView(withId(R.id.target_button_verify))
.perform(scrollTo())
takeScreenshot<SubmissionSymptomIntroductionFragment>("2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class SubmissionTestResultAvailableFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -79,20 +80,20 @@ class SubmissionTestResultAvailableFragmentTest : BaseUITest() {
@Screenshot
fun capture_fragment_with_consent() {
every { viewModel.consent } returns MutableLiveData(true)
captureScreenshot<SubmissionTestResultAvailableFragment>(
suffix = "_consent",
launchFragmentInContainer2<SubmissionTestResultAvailableFragment>(
fragmentArgs = resultAvailableFragmentArgs
)
takeScreenshot<SubmissionTestResultAvailableFragment>(suffix = "_consent")
}

@Test
@Screenshot
fun capture_fragment_without_consent() {
every { viewModel.consent } returns MutableLiveData(false)
captureScreenshot<SubmissionTestResultAvailableFragment>(
suffix = "_no_consent",
launchFragmentInContainer2<SubmissionTestResultAvailableFragment>(
fragmentArgs = resultAvailableFragmentArgs
)
takeScreenshot<SubmissionTestResultAvailableFragment>(suffix = "_no_consent")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.rki.coronawarnapp.ui.submission

import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.lifecycle.MutableLiveData
import androidx.navigation.Navigation
import androidx.navigation.testing.TestNavHostController
Expand Down Expand Up @@ -35,9 +36,9 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragment2
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class SubmissionTestResultConsentGivenFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -91,7 +92,10 @@ class SubmissionTestResultConsentGivenFragmentTest : BaseUITest() {

@Test
fun testEventConsentGivenContinueWithSymptomsClicked() {
launchFragmentInContainer2<SubmissionTestResultConsentGivenFragment>(consentGivenFragmentArgs).onFragment { fragment ->
launchFragmentInContainer<SubmissionTestResultConsentGivenFragment>(
themeResId = R.style.AppTheme_Main,
fragmentArgs = consentGivenFragmentArgs
).onFragment { fragment ->
Navigation.setViewNavController(fragment.requireView(), navController)
}
// Verify that performing a click prompts the correct Navigation action
Expand All @@ -111,7 +115,8 @@ class SubmissionTestResultConsentGivenFragmentTest : BaseUITest() {
)
)

captureScreenshot<SubmissionTestResultConsentGivenFragment>(fragmentArgs = consentGivenFragmentArgs)
launchFragmentInContainer2<SubmissionTestResultConsentGivenFragment>(fragmentArgs = consentGivenFragmentArgs)
takeScreenshot<SubmissionTestResultConsentGivenFragment>()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragment2
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class SubmissionTestResultFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -117,7 +117,8 @@ class SubmissionTestResultFragmentTest : BaseUITest() {
}
)
)
captureScreenshot<SubmissionTestResultPendingFragment>(fragmentArgs = pendingFragmentArgs)
launchFragmentInContainer2<SubmissionTestResultPendingFragment>(fragmentArgs = pendingFragmentArgs)
takeScreenshot<SubmissionTestResultPendingFragment>()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class SubmissionTestResultNegativeFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -77,7 +78,8 @@ class SubmissionTestResultNegativeFragmentTest : BaseUITest() {
}
)
)
captureScreenshot<SubmissionTestResultNegativeFragment>(fragmentArgs = resultNegativeFragmentArgs)
launchFragmentInContainer2<SubmissionTestResultNegativeFragment>(fragmentArgs = resultNegativeFragmentArgs)
takeScreenshot<SubmissionTestResultNegativeFragment>()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import org.junit.runner.RunWith
import testhelpers.BaseUITest
import testhelpers.Screenshot
import testhelpers.TestDispatcherProvider
import testhelpers.captureScreenshot
import testhelpers.launchFragmentInContainer2
import testhelpers.takeScreenshot

@RunWith(AndroidJUnit4::class)
class SubmissionTestResultNoConsentGivenFragmentTest : BaseUITest() {
Expand Down Expand Up @@ -78,7 +79,8 @@ class SubmissionTestResultNoConsentGivenFragmentTest : BaseUITest() {
)
)

captureScreenshot<SubmissionTestResultNoConsentFragment>(fragmentArgs = noConsentGivenFragmentArgs)
launchFragmentInContainer2<SubmissionTestResultNoConsentFragment>(fragmentArgs = noConsentGivenFragmentArgs)
takeScreenshot<SubmissionTestResultNoConsentFragment>()
}
}

Expand Down