Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes part of #3362: Fix test cases for AccessibilityChecks #3372

Merged
merged 2 commits into from
Jun 24, 2021

Conversation

rt4914
Copy link
Contributor

@rt4914 rt4914 commented Jun 23, 2021

Explanation

Fixes part of #3362: Fix test cases for AccessibilityChecks

This PR fixes some of the AccessibilityChecks failures across multiple test files.

Please check comments for better understanding.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@@ -46,6 +46,7 @@
android:focusableInTouchMode="true"
android:fontFamily="sans-serif"
android:marqueeRepeatLimit="1"
android:minHeight="48dp"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is clickable, it should be 48dp min height.

@@ -45,6 +45,7 @@
android:focusableInTouchMode="true"
android:fontFamily="sans-serif"
android:marqueeRepeatLimit="1"
android:minHeight="48dp"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is clickable, it should be 48dp min height.

@@ -68,6 +48,16 @@
android:text="@{htmlContent}"
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
android:visibility="@{htmlContent.length() > 0 ? View.VISIBLE : View.GONE, default=gone}" />
android:visibility="@{htmlContent.length() > 0 ? View.VISIBLE : View.GONE, default=gone}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content-item can have internal-links which are clickable and therefore the min-height should be 48dp. Now consider a case where the text is only of 1 line, in that case the min-height is less than 48dp and therefore I have shifted the padding of FrameLayout to TextView and also I have increased the padding-top/bottom from 12dp to 16dp in dimens.xml files too.

Same concept applies for FeedbackItem too.

@@ -68,6 +48,16 @@
android:text="@{htmlContent}"
android:textColor="@color/oppiaPrimaryText"
android:textSize="16sp"
android:visibility="@{htmlContent.length() > 0 ? View.VISIBLE : View.GONE, default=gone}" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FeedbackItem can have internal-links which are clickable and therefore the min-height should be 48dp. Now consider a case where the text is only of 1 line, in that case the min-height is less than 48dp and therefore I have shifted the padding of FrameLayout to TextView and also I have increased the padding-top/bottom from 12dp to 16dp in dimens.xml files too.

Same concept applies for ContentItem too.

@@ -44,6 +44,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_weight="1"
android:minHeight="48dp"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is clickable, it should be 48dp min height.

@@ -40,6 +40,7 @@
android:focusableInTouchMode="true"
android:fontFamily="sans-serif"
android:marqueeRepeatLimit="1"
android:minHeight="48dp"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is clickable, it should be 48dp min height.

@@ -45,6 +45,7 @@
android:focusableInTouchMode="true"
android:fontFamily="sans-serif"
android:marqueeRepeatLimit="1"
android:minHeight="48dp"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is clickable, it should be 48dp min height.

@@ -252,7 +252,6 @@ class ExplorationActivityTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these tests are passing now but 3 tests are still failing for which I have kept the annotation DisableAccessibilityChecks .

When all DisableAccessibilityChecks are removed and not fixed.
Screenshot 2021-06-24 at 1 29 59 AM

When all DisableAccessibilityChecks are fixed except 3.
Screenshot 2021-06-24 at 2 12 23 AM

@@ -288,7 +288,6 @@ class StateFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
Copy link
Contributor Author

@rt4914 rt4914 Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in toolbar and content/feedback item fixes 36 test cases in this. 12 test cases are still pending which will be fixed later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2021-06-24 at 3 16 58 AM

@@ -119,7 +118,6 @@ class RevisionCardFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed because we mentioned minHeight 48dp in toolbar text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2021-06-24 at 2 25 44 AM

@anandwana001
Copy link
Contributor

Re running gradel task

Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, waiting for gradel task to pass

@oppiabot
Copy link

oppiabot bot commented Jun 24, 2021

Unassigning @anandwana001 since they have already approved the PR.

@oppiabot oppiabot bot added the PR: LGTM label Jun 24, 2021
@anandwana001 anandwana001 merged commit 0a3cdb6 into develop Jun 24, 2021
@anandwana001 anandwana001 deleted the fix-a11y-checks-2 branch June 24, 2021 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants