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 #3169: ItemSelectionInteraction text change on selection #3814

Conversation

darkmat13r
Copy link
Contributor

@darkmat13r darkmat13r commented Sep 18, 2021

Explanation

Fix #3169 : ItemSelectionInteraction text change on selection

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).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

Before

After

@darkmat13r
Copy link
Contributor Author

@rt4914 PTAL

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.

@darkmat13r Thanks a lot. Just need to add one more test case otherwise LGTM

@rt4914 rt4914 assigned darkmat13r and unassigned rt4914 Sep 21, 2021
@rt4914 rt4914 assigned rt4914 and unassigned darkmat13r Sep 24, 2021
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.

LGTM, thanks.

@BenHenning Any idea why bazel tests are failing?

@rt4914 rt4914 assigned BenHenning and unassigned rt4914 Sep 24, 2021
@BenHenning BenHenning changed the title Fix ##3169 : ItemSelectionInteraction text change on selection Fix #3169: ItemSelectionInteraction text change on selection Sep 26, 2021
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @darkmat13r! Just had a few comments--PTAL.

}

@Test
fun testStateFragment_interactions_land_singleItemSelected_selectionTextIsNotDisplayed() {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add tests to demonstrate that the selection text retains its showing/not showing behavior after performing a rotation & activity recreation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BenHenning Yes. I will add the test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BenHenning I have remove the landscape test cases as these doesn't make sense because currently when you select some answers and rotate the screen all values gets lost. So right now we can't add those test cases related to orientation change or activity recreation.
Follow are the removed test cases for landscape orientation:
testStateFragment_interactions_land_noItemSelected_selectionTextIsDisplayed
testStateFragment_interactions_land_singleItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_land_multipleItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_changeConfiguration_selectUnselectCheckbox_selectionTextIsDisplayedCorrectly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Ah, yes that's related to #1594. Fair point--I think omitting these tests are fine. Instead, can you add a TODO, such as:

// TODO(#1594): Add tests to ensure the selection text is properly showing/not showing after a configuration change.

@@ -46,7 +46,7 @@
android:textColor="@color/oppiaPrimaryText"
android:textSize="14sp"
android:textStyle="italic"
android:visibility="@{viewModel.getSelectionItemInputType() == SelectionItemInputType.RADIO_BUTTONS ? View.GONE : View. VISIBLE}" />
android:visibility="@{viewModel.getSelectionItemInputType() == SelectionItemInputType.RADIO_BUTTONS || viewModel.selectedItemsCount > 0 ? View.GONE : View. VISIBLE}" />
Copy link
Member

Choose a reason for hiding this comment

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

Given the OR here, do we already have tests verifying that the text is always showing for radio buttons for both unselected & selected states to contrast with the checkbox behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BenHenning No, I will add them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BenHenning For the radio buttons the text will always be hidden. I am not sure we need tests for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BenHenning I have added test case for the radio buttons.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I think you also need a test for state 2 (which is MultipleChoiceInput) to ensure that the text view is correctly arranged for that interaction, as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BenHenning state 2 is Fraction input option. State 3 and state 4 are multiple choice input. I have already added the test case for state 4.

@Test
 fun testStateFragment_interactions_radioItemSelection_selectionTextIsNotDisplayed() {
     launchForExploration(TEST_EXPLORATION_ID_2, shouldSavePartialProgress = false).use {
      startPlayingExploration()
      playThroughPrototypeState1()
      playThroughPrototypeState2()
      playThroughPrototypeState3()

      // Verify that the user is now on the fourth state.
      verifyViewTypeIsPresent(SELECTION_INTERACTION)
      onView(withId(R.id.selection_interaction_textview)).check(matches(not(isDisplayed())))
    }
  }

//Added these additional test cases

testStateFragment_interactions_singleRadioItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_multipleRadioItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_correctRadioItemSelected_selectionTextIsNotDisplayed

@BenHenning BenHenning assigned darkmat13r and unassigned BenHenning Sep 26, 2021
@oppiabot
Copy link

oppiabot bot commented Oct 10, 2021

Hi @darkmat13r, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added stale Corresponds to items that haven't seen a recent update and may be automatically closed. and removed stale Corresponds to items that haven't seen a recent update and may be automatically closed. labels Oct 10, 2021
@oppiabot
Copy link

oppiabot bot commented Oct 28, 2021

Hi @darkmat13r, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 28, 2021
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 29, 2021
@oppiabot
Copy link

oppiabot bot commented Nov 5, 2021

Hi @darkmat13r, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 5, 2021
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 7, 2021
@oppiabot
Copy link

oppiabot bot commented Nov 14, 2021

Hi @darkmat13r, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 14, 2021
@rt4914 rt4914 self-assigned this Nov 17, 2021
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 17, 2021
@rt4914
Copy link
Contributor

rt4914 commented Nov 18, 2021

@darkmat13r Can you please reply to all the open-comments, that way based on reply Ben can decide if that comment can be resolved or not. Thanks

@rt4914 rt4914 removed their assignment Nov 18, 2021
@darkmat13r
Copy link
Contributor Author

@darkmat13r Can you please reply to all the open-comments, that way based on reply Ben can decide if that comment can be resolved or not. Thanks

@BenHenning @rt4914 All the comments are resolved but I am not able to run the test cases. Some test cases are failing so I need to fix them.

@BenHenning
Copy link
Member

FYI I'm listed as a codeowner for this PR & I'll be unavailable to perform code reviews over the next 2 weeks--thanks for your patience.

@BenHenning BenHenning self-assigned this Nov 20, 2021
@BenHenning
Copy link
Member

@darkmat13r Can you please reply to all the open-comments, that way based on reply Ben can decide if that comment can be resolved or not. Thanks

@BenHenning @rt4914 All the comments are resolved but I am not able to run the test cases. Some test cases are failing so I need to fix them.

@darkmat13r why aren't you able to run the test cases? It'd be really helpful to get more context. Please see https://github.com/oppia/oppia-android/wiki/Frequent-Errors-and-Solutions#facing-error-while-debugging-code which includes tips on debugging, and instructions for creating a debug doc that you can share with folks to make it easier for them to help you.

@BenHenning BenHenning removed their assignment Nov 20, 2021
@darkmat13r
Copy link
Contributor Author

darkmat13r commented Nov 23, 2021

@BenHenning Not able to run the test cases on android studio artic fox version. The solution i mention to work on Java Idea community version also not working . I will provide more details on the error.
#3783

@rt4914 rt4914 assigned rt4914 and unassigned rt4914 Nov 24, 2021
@oppiabot
Copy link

oppiabot bot commented Dec 3, 2021

Hi @darkmat13r, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Dec 3, 2021
@oppiabot oppiabot bot closed this Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Corresponds to items that haven't seen a recent update and may be automatically closed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ItemSelectionInteraction text change on selection
3 participants