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

Shift RichTextViewMatcher to Testing module #3053

Closed
anandwana001 opened this issue Apr 8, 2021 · 9 comments · Fixed by #3173
Closed

Shift RichTextViewMatcher to Testing module #3053

anandwana001 opened this issue Apr 8, 2021 · 9 comments · Fixed by #3173
Assignees
Labels
good first issue This item is good for new contributors to make their pull request. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@anandwana001
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, RichTextViewMatcher is inside the sharedTest folder of app module.

Describe the solution you'd like
RichTextViewMatcher is a helper class. Thus, it needs ti be in the testing module.

Additional context
https://github.com/oppia/oppia-android/blob/develop/app/src/sharedTest/java/org/oppia/android/app/parser/RichTextViewMatcher.kt

@anandwana001 anandwana001 added Type: Improvement good first issue This item is good for new contributors to make their pull request. labels Apr 8, 2021
@Sparsh1212
Copy link
Contributor

I would like to work on this.

@Sparsh1212
Copy link
Contributor

Apologies for the delay. I have my semester exams going on currently. @rt4914 Will it be okay if I finish this by the end of this week?

@anandwana001
Copy link
Contributor Author

@Sparsh1212 any update on this?

@Sparsh1212
Copy link
Contributor

Sparsh1212 commented Apr 21, 2021

@anandwana001
I was actually waiting for the other PR to get merged. (Shifting RecyclerViewMatcher) because it will result into merge conflicts because it will involve reordering of imports with this, if i start working on it now. Shall I start working on this now or wait for it to get merged?

@anandwana001
Copy link
Contributor Author

I think that's up to you, as both the issues are assigned to you.
For RecyclerViewMatcher , I suggest following https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section to speed things up.

@Sparsh1212
Copy link
Contributor

I think that's up to you, as both the issues are assigned to you.
For RecyclerViewMatcher , I suggest following https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section to speed things up.

I think it will be better if we wait for it to get merged first. Then as soon as its completed, I'll initiate a fix for this.
Also, apologies for not assigning the reviewers for the RecyclerViewMatcher, I addressed all the comments but it just slipped from my mind to assign the reviewers and unassign myself. Will try to not to repeat it next time.

@Sparsh1212
Copy link
Contributor

@anandwana001 I have done the changes to fix this issue, but unfortunately I am not able to push the changes to the origin because of one ktlint issue in imports ordering. I also tried Ctrl+Alt+O in the file having ktlint issue but still no luck. Can you please help in identifying where import order is incorrect?
New Import order after shifting:

import android.app.Application
import android.content.Context
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.test.core.app.ActivityScenario.launch
import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.matcher.RootMatchers.isDialog
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withParent
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
import dagger.Component
import dagger.Module
import dagger.Provides
import javax.inject.Inject
import javax.inject.Singleton
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.instanceOf
import org.hamcrest.Matchers.not
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.oppia.android.R
import org.oppia.android.app.activity.ActivityComponent
import org.oppia.android.app.application.ActivityComponentFactory
import org.oppia.android.app.application.ApplicationComponent
import org.oppia.android.app.application.ApplicationInjector
import org.oppia.android.app.application.ApplicationInjectorProvider
import org.oppia.android.app.application.ApplicationModule
import org.oppia.android.app.application.ApplicationStartupListenerModule
import org.oppia.android.app.player.state.hintsandsolution.HintsAndSolutionConfigModule
import org.oppia.android.app.shim.ViewBindingShimModule
import org.oppia.android.app.testing.ConceptCardFragmentTestActivity
import org.oppia.android.app.topic.PracticeTabModule
import org.oppia.android.app.utility.OrientationChangeAction.Companion.orientationLandscape
import org.oppia.android.domain.classify.InteractionsModule
import org.oppia.android.domain.classify.rules.continueinteraction.ContinueModule
import org.oppia.android.domain.classify.rules.dragAndDropSortInput.DragDropSortInputModule
import org.oppia.android.domain.classify.rules.fractioninput.FractionInputModule
import org.oppia.android.domain.classify.rules.imageClickInput.ImageClickInputModule
import org.oppia.android.domain.classify.rules.itemselectioninput.ItemSelectionInputModule
import org.oppia.android.domain.classify.rules.multiplechoiceinput.MultipleChoiceInputModule
import org.oppia.android.domain.classify.rules.numberwithunits.NumberWithUnitsRuleModule
import org.oppia.android.domain.classify.rules.numericinput.NumericInputRuleModule
import org.oppia.android.domain.classify.rules.ratioinput.RatioInputModule
import org.oppia.android.domain.classify.rules.textinput.TextInputRuleModule
import org.oppia.android.domain.onboarding.ExpirationMetaDataRetrieverModule
import org.oppia.android.domain.oppialogger.LogStorageModule
import org.oppia.android.domain.oppialogger.loguploader.LogUploadWorkerModule
import org.oppia.android.domain.oppialogger.loguploader.WorkManagerConfigurationModule
import org.oppia.android.domain.question.QuestionModule
import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule
import org.oppia.android.testing.RichTextViewMatcher.Companion.containsRichText
import org.oppia.android.testing.TestLogReportingModule
import org.oppia.android.testing.environment.TestEnvironmentConfig
import org.oppia.android.testing.robolectric.RobolectricModule
import org.oppia.android.testing.threading.TestDispatcherModule
import org.oppia.android.testing.time.FakeOppiaClockModule
import org.oppia.android.util.accessibility.AccessibilityTestModule
import org.oppia.android.util.caching.CacheAssetsLocally
import org.oppia.android.util.caching.LoadImagesFromAssets
import org.oppia.android.util.caching.LoadLessonProtosFromAssets
import org.oppia.android.util.caching.TopicListToCache
import org.oppia.android.util.gcsresource.GcsResourceModule
import org.oppia.android.util.logging.LoggerModule
import org.oppia.android.util.logging.firebase.FirebaseLogUploaderModule
import org.oppia.android.util.parser.GlideImageLoaderModule
import org.oppia.android.util.parser.HtmlParserEntityTypeModule
import org.oppia.android.util.parser.ImageParsingModule
import org.robolectric.annotation.Config
import org.robolectric.annotation.LooperMode 

ktlint error:

/home/dell/Desktop/opensource/oppia-android/app/src/sharedTest/java/org/oppia/android/app/topic/conceptcard/ConceptCardFragmentTest.kt:3:1: Imports must be ordered in lexicographic order without any empty lines in-between with "java", "javax", "kotlin" and aliases in the end

@anandwana001
Copy link
Contributor Author

anandwana001 commented May 7, 2021

"java", "javax", "kotlin" and aliases in the end

@Sparsh1212 Have you tried this - https://github.com/oppia/oppia-android/wiki/Ktlint-Guide#macros ?

@Sparsh1212
Copy link
Contributor

"java", "javax", "kotlin" and aliases in the end

@Sparsh1212 Have you tried this - https://github.com/oppia/oppia-android/wiki/Ktlint-Guide#macros ?

Thank you! that worked.

anandwana001 pushed a commit that referenced this issue May 13, 2021
* Fix #3053: Shift RichTextViewMatcher to Testing module

* Fix ktlint issue

* Fix build.bazel error

* Remove input file from test deps of app level BUILD.bazel
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This item is good for new contributors to make their pull request. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Development

Successfully merging a pull request may close this issue.

3 participants