Skip to content

Commit

Permalink
Fixed A11y tests for ProfileProgressFragmentTest (oppia#3392)
Browse files Browse the repository at this point in the history
Co-authored-by: Rajat Talesra <[email protected]>
  • Loading branch information
rt4914 and Rajat Talesra committed Jun 29, 2021
1 parent a918b1c commit 10b5e92
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
2 changes: 2 additions & 0 deletions app/src/main/res/layout-land/profile_progress_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
android:layout_width="160dp"
android:layout_height="160dp"
android:clickable="true"
android:contentDescription="@string/current_profile_picture_content_description"
android:focusable="true"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
app:add_shadow="true"
Expand All @@ -34,6 +35,7 @@
<ImageView
android:layout_width="56dp"
android:layout_height="56dp"
android:contentDescription="@string/edit_profile_picture_content_description"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
android:paddingStart="12dp"
android:paddingTop="12dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:layout_height="160dp"
android:layout_marginStart="202dp"
android:clickable="true"
android:contentDescription="@string/current_profile_picture_content_description"
android:focusable="true"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
app:add_shadow="true"
Expand All @@ -33,6 +34,7 @@
<ImageView
android:layout_width="56dp"
android:layout_height="56dp"
android:contentDescription="@string/edit_profile_picture_content_description"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
android:paddingStart="12dp"
android:paddingTop="12dp"
Expand All @@ -45,14 +47,14 @@
android:id="@+id/profile_name_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="44dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="202dp"
android:fontFamily="sans-serif-medium"
android:text="@{viewModel.profile.name}"
android:textAlignment="viewStart"
android:textColor="@color/oppiaPrimaryText"
android:textSize="28sp"
android:textAlignment="viewStart"
android:layout_marginStart="44dp"
android:layout_marginEnd="202dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/profile_edit_image"
app:layout_constraintTop_toTopOf="parent" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:layout_height="160dp"
android:layout_marginStart="42dp"
android:clickable="true"
android:contentDescription="@string/current_profile_picture_content_description"
android:focusable="true"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
app:add_shadow="true"
Expand All @@ -33,6 +34,7 @@
<ImageView
android:layout_width="56dp"
android:layout_height="56dp"
android:contentDescription="@string/edit_profile_picture_content_description"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
android:paddingStart="12dp"
android:paddingTop="12dp"
Expand All @@ -46,13 +48,13 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="44dp"
android:layout_marginEnd="42dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="42dp"
android:fontFamily="sans-serif-medium"
android:text="@{viewModel.profile.name}"
android:textAlignment="viewStart"
android:textColor="@color/oppiaPrimaryText"
android:textSize="28sp"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/profile_edit_image"
app:layout_constraintTop_toTopOf="parent" />
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/profile_progress_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
android:layout_width="100dp"
android:layout_height="100dp"
android:clickable="true"
android:contentDescription="@string/current_profile_picture_content_description"
android:focusable="true"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
app:add_shadow="true"
Expand All @@ -35,6 +36,7 @@
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/edit_profile_picture_content_description"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
android:paddingStart="8dp"
android:paddingTop="8dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ import org.oppia.android.domain.topic.FRACTIONS_STORY_ID_0
import org.oppia.android.domain.topic.FRACTIONS_TOPIC_ID
import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule
import org.oppia.android.testing.AccessibilityTestRule
import org.oppia.android.testing.DisableAccessibilityChecks
import org.oppia.android.testing.TestLogReportingModule
import org.oppia.android.testing.profile.ProfileTestHelper
import org.oppia.android.testing.robolectric.RobolectricModule
Expand Down Expand Up @@ -188,7 +187,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testProfileProgressFragment_profilePictureEditDialogIsDisplayed() {
launch<ProfileProgressActivity>(createProfileProgressActivityIntent(internalProfileId)).use {
testCoroutineDispatchers.runCurrent()
Expand All @@ -199,7 +197,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3363): Enable AccessibilityChecks
fun testProfileProgressFragment_openProfilePictureEditDialog_configChange_dialogIsStillOpen() {
launch<ProfileProgressActivity>(createProfileProgressActivityIntent(internalProfileId)).use {
testCoroutineDispatchers.runCurrent()
Expand All @@ -211,7 +208,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testProfileProgressFragment_imageSelectAvatar_checkGalleryIntent() {
val expectedIntent: Matcher<Intent> = allOf(
hasAction(Intent.ACTION_PICK),
Expand All @@ -230,7 +226,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testProfileProgressFragment_imageSelectAvatar_configChange_checkGalleryIntent() {
val expectedIntent: Matcher<Intent> = allOf(
hasAction(Intent.ACTION_PICK),
Expand Down Expand Up @@ -396,7 +391,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testProfileProgressFragment_twoPartialStoryProgress_completedStoriesCountIsTwo() {
storyProgressTestHelper.markCompletedRatiosStory0(
profileId,
Expand Down Expand Up @@ -512,7 +506,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3363): Enable AccessibilityChecks
fun testProfileProgressFragment_clickFractionsStory_opensTopicActivity() {
storyProgressTestHelper.markRecentlyPlayedFractionsStory0Exp0(
profileId,
Expand All @@ -535,7 +528,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3363): Enable AccessibilityChecks
fun testProfileProgressFragment_clickViewAll_opensRecentlyPlayedActivity() {
storyProgressTestHelper.markRecentlyPlayedFractionsStory0Exp0(
profileId = ProfileId.newBuilder().setInternalId(internalProfileId).build(),
Expand Down Expand Up @@ -604,7 +596,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testProfileProgressFragment_clickTopicCount_opensOngoingTopicListActivity() {
storyProgressTestHelper.markCompletedFractionsStory0Exp0(
profileId = profileId,
Expand Down Expand Up @@ -634,7 +625,6 @@ class ProfileProgressFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testProfileProgressFragment_clickStoryCount_opensCompletedStoryListActivity() {
storyProgressTestHelper.markCompletedRatiosStory0(
profileId = profileId,
Expand Down

0 comments on commit 10b5e92

Please sign in to comment.