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

Fix #3362 Use OppiaTestRule in all Espresso Tests #4179

Merged
merged 25 commits into from
Mar 7, 2022

Conversation

vrajdesai78
Copy link
Contributor

@vrajdesai78 vrajdesai78 commented Feb 14, 2022

Explanation

Fix #3362 by fixing all to-dos which were mentioned by Github-Actions. I have removed AccessibilityChecks according to mentioned To-dos.

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

Screenshots of passing testcases

Screenshot from 2022-02-21 18-41-14
Screenshot from 2022-02-21 18-47-27
Screenshot from 2022-02-21 18-48-59
Screenshot from 2022-02-21 22-37-20
Screenshot from 2022-02-21 22-38-19
Screenshot from 2022-02-21 22-59-39
Screenshot from 2022-02-22 00-02-26

Issues Filed for failing test cases

Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

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

@vrajdesai78 Three suggestions:

  1. If you have removed DisableAccessibilityChecks then // TODO(#3362): Enable AccessibilityChecks is not required.
  2. If you have added DisableAccessibilityChecks please add a comment+TODO mentioning why this is needed, maybe explain the type of error.
  3. For all test files which are changed in this PR please add screenshot of them running on Espresso.

@vrajdesai78
Copy link
Contributor Author

What issue number should I add in TODO can I add #3245 as it is related to enabling Accessibility Checks or current issue number if I add DisableAccessbilityCheckes

@rt4914 PTAL.

@vrajdesai78
Copy link
Contributor Author

Passing Testcases after DisablingAccessbility Checks
Screenshot from 2022-02-14 16-52-05
Screenshot from 2022-02-14 16-52-56
Screenshot from 2022-02-14 16-53-39

@oppiabot oppiabot bot assigned rt4914 and unassigned vrajdesai78 Feb 14, 2022
@oppiabot
Copy link

oppiabot bot commented Feb 14, 2022

Unassigning @vrajdesai78 since a re-review was requested. @vrajdesai78, please make sure you have addressed all review comments. Thanks!

Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

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

@vrajdesai78 I think the above suggestions are not fully applied yet.

  1. There are many new files which uses OppiaTestRule in this PR and I am unable to see screenshots of espresso-test for all of them.
  2. In PinPasswordActivityTest uses DisableAccessibilityChecks and there are no comments for it.
  3. If there is any ...TestActivityTest like InputInteractionViewTestActivityTest . In this along with DisableAccessibilityChecks please add one comment (not TODO) mentioning Disabled as this is a test file and will not be used by user. (We might update this comment later but for now having a comment is important)

@@ -98,6 +99,9 @@ class ImageViewBindingAdaptersTest {
@get:Rule
val initializeDefaultLocaleRule = InitializeDefaultLocaleRule()

@get:Rule
val oppiaTestRule = OppiaTestRule()
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add screenshot of espresso tests passing for this file too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, there is an issue with this Test. I have already created an issue for same #4149

@rt4914 rt4914 assigned vrajdesai78 and unassigned rt4914 Feb 14, 2022
@vrajdesai78
Copy link
Contributor Author

vrajdesai78 commented Feb 14, 2022

@vrajdesai78 I think the above suggestions are not fully applied yet.

  1. There are many new files which uses OppiaTestRule in this PR and I am unable to see screenshots of espresso-test for all of them.
  2. In PinPasswordActivityTest uses DisableAccessibilityChecks and there are no comments for it.
  3. If there is any ...TestActivityTest like InputInteractionViewTestActivityTest . In this along with DisableAccessibilityChecks please add one comment (not TODO) mentioning Disabled as this is a test file and will not be used by user. (We might update this comment later but for now having a comment is important)

Actually, I have added all the screenshots in #4133.

@vrajdesai78
Copy link
Contributor Author

@rt4914 PTAL.

@vrajdesai78 vrajdesai78 assigned anandwana001 and unassigned rt4914 Feb 24, 2022
@rt4914 rt4914 assigned rt4914 and unassigned vrajdesai78 Mar 1, 2022
Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

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

@vrajdesai78 Suggested changes.

@@ -613,7 +616,9 @@ class StoryFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3362): Enable AccessibilityChecks
// TODO(#3245): Error -> View falls below the minimum recommended size for touch targets
// TODO(#3245): Error -> URLSpan should be used in place of ClickableSpan
Copy link
Contributor

Choose a reason for hiding this comment

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

Please mention it as a single TODO with both the errors.

// TODO(#3245): Use URLSpan and minimum touch target size should be 48x48 dp

@@ -668,6 +673,8 @@ class StoryFragmentTest {
}

@Config(qualifiers = "+sw600dp")
// TODO(#4212): Error -> No views in hierarchy found matching: with
// id: org.oppia.android:id/story_chapter_list
Copy link
Contributor

Choose a reason for hiding this comment

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

Reduce to single line and don't mention ids. Just the error info is enough.

@@ -684,6 +691,8 @@ class StoryFragmentTest {
}

@Config(qualifiers = "+sw600dp")
// TODO(#4212): Error -> No views in hierarchy found matching: with
// id: org.oppia.android:id/story_chapter_list
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

@@ -699,6 +708,8 @@ class StoryFragmentTest {
}

@Config(qualifiers = "+sw600dp")
// TODO(#4212): Error -> No views in hierarchy found matching: with
// id: org.oppia.android:id/story_chapter_list
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

@rt4914 rt4914 assigned vrajdesai78 and unassigned rt4914 Mar 1, 2022
Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

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

@vrajdesai78 LGTM. Suggested one minor change. When writing such code please focuse on consistency.

@rt4914 rt4914 removed their assignment Mar 2, 2022
@oppiabot
Copy link

oppiabot bot commented Mar 2, 2022

Assigning @BenHenning for code owner reviews. Thanks!

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,

left a nit suggestion.

@anandwana001 anandwana001 removed their assignment Mar 2, 2022
@BenHenning BenHenning removed their assignment Mar 4, 2022
@BenHenning
Copy link
Sponsor Member

It appears my codeowners is no longer needed. I think @rt4914 just needs to verify the remaining changes before this can be merged.

@rt4914 rt4914 merged commit 0d61dfc into oppia:develop Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use OppiaTestRule in all Espresso Tests
4 participants