File tree Expand file tree Collapse file tree 2 files changed +3
-24
lines changed
app/src/androidTest/kotlin/org/wordpress/aztec/demo Expand file tree Collapse file tree 2 files changed +3
-24
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,6 @@ class EditorPage : BasePage() {
5555 private var photoButton: ViewInteraction
5656 private var galleryButton: ViewInteraction
5757
58- private var currentActivity: Activity ?
59-
6058 override val trait: ViewInteraction
6159 get() = onView(withId(R .id.aztec))
6260
@@ -84,27 +82,6 @@ class EditorPage : BasePage() {
8482
8583 photoButton = onView(allOf(withId(android.R .id.title), withText(" Photo from device" )))
8684 galleryButton = onView(withId(R .id.media_bar_button_gallery))
87-
88- currentActivity = null
89- }
90-
91- private fun getActivityInstance (): Activity ? {
92- getInstrumentation().runOnMainSync {
93- val resumedActivities = ActivityLifecycleMonitorRegistry .getInstance().getActivitiesInStage(Stage .RESUMED )
94- if (resumedActivities.iterator().hasNext()) {
95- currentActivity = resumedActivities.iterator().next() as Activity
96- }
97- }
98-
99- return currentActivity
100- }
101-
102- fun getAztecText (): AztecText ? {
103- return getActivityInstance()?.findViewById(R .id.aztec)
104- }
105-
106- fun getAztecSourceEditor (): SourceViewEditText ? {
107- return getActivityInstance()?.findViewById(R .id.source)
10885 }
10986
11087 fun tapTop (): EditorPage {
Original file line number Diff line number Diff line change @@ -312,7 +312,9 @@ class GutenbergCompatTests : BaseTest() {
312312
313313 val editorPage = EditorPage ()
314314 val audioShortcodePlugin = AudioShortcodePlugin ()
315- editorPage.getAztecText()?.plugins?.add(audioShortcodePlugin)
315+ val aztecText = mActivityIntentsTestRule.activity.findViewById<AztecText >(R .id.aztec)
316+ aztecText.plugins?.add(audioShortcodePlugin)
317+
316318 // let's test the plugin works as expected, i.e. it preserves the Gutenberg block structure
317319 editorPage
318320 .toggleHtml()
You can’t perform that action at this time.
0 commit comments