@@ -122,8 +122,8 @@ abstract class BaseTest : BaseActivityTestImplementation {
122
122
*/
123
123
protected fun isToastDisplayed (decorView : View ? , message : String ) {
124
124
onView(withText(message))
125
- .inRoot(withDecorView(not (`is `(decorView))))
126
- .check(matches(isDisplayed()))
125
+ .inRoot(withDecorView(not (`is `(decorView))))
126
+ .check(matches(isDisplayed()))
127
127
}
128
128
129
129
/* *
@@ -133,8 +133,8 @@ abstract class BaseTest : BaseActivityTestImplementation {
133
133
*/
134
134
protected fun isDialogWithTextDisplayed (decorView : View ? , message : String ) {
135
135
onView(withText(message))
136
- .inRoot(withDecorView(not (`is `(decorView))))
137
- .check(matches(isDisplayed()))
136
+ .inRoot(withDecorView(not (`is `(decorView))))
137
+ .check(matches(isDisplayed()))
138
138
}
139
139
140
140
/* *
@@ -143,15 +143,15 @@ abstract class BaseTest : BaseActivityTestImplementation {
143
143
// todo-denbond7 - fix me
144
144
protected fun testHelpScreen () {
145
145
onView(withId(R .id.menuActionHelp))
146
- .check(matches(isDisplayed()))
147
- .perform(click())
146
+ .check(matches(isDisplayed()))
147
+ .perform(click())
148
148
149
149
onView(withId(R .id.textViewAuthorHint))
150
- .check(matches(isDisplayed()))
151
- .check(matches(withText(R .string.i_will_usually_reply_within_an_hour_except_when_i_sleep_tom)))
150
+ .check(matches(isDisplayed()))
151
+ .check(matches(withText(R .string.i_will_usually_reply_within_an_hour_except_when_i_sleep_tom)))
152
152
153
153
onView(withText(R .string.help_feedback_or_question))
154
- .check(matches(isDisplayed()))
154
+ .check(matches(isDisplayed()))
155
155
}
156
156
157
157
/* *
@@ -163,8 +163,8 @@ abstract class BaseTest : BaseActivityTestImplementation {
163
163
onView(withText(message)).check(matches(isDisplayed()))
164
164
165
165
onView(withId(com.google.android.material.R .id.snackbar_action))
166
- .check(matches(isDisplayed()))
167
- .perform(click())
166
+ .check(matches(isDisplayed()))
167
+ .perform(click())
168
168
}
169
169
170
170
/* *
@@ -173,11 +173,11 @@ abstract class BaseTest : BaseActivityTestImplementation {
173
173
protected fun checkIsSnackBarDisplayed (text : String? = null) {
174
174
if (text.isNullOrEmpty()) {
175
175
onView(withId(com.google.android.material.R .id.snackbar_action))
176
- .check(matches(isDisplayed()))
176
+ .check(matches(isDisplayed()))
177
177
} else {
178
178
onView(withId(com.google.android.material.R .id.snackbar_text))
179
- .check(matches(isDisplayed()))
180
- .check(matches(withText(text)))
179
+ .check(matches(isDisplayed()))
180
+ .check(matches(withText(text)))
181
181
}
182
182
}
183
183
@@ -186,7 +186,7 @@ abstract class BaseTest : BaseActivityTestImplementation {
186
186
*/
187
187
protected fun checkIsSnackBarNotDisplayed () {
188
188
onView(withId(com.google.android.material.R .id.snackbar_action))
189
- .check(doesNotExist())
189
+ .check(doesNotExist())
190
190
}
191
191
192
192
/* *
@@ -198,14 +198,16 @@ abstract class BaseTest : BaseActivityTestImplementation {
198
198
*/
199
199
protected fun addTextToClipboard (label : String , text : String ) {
200
200
runOnUiThread {
201
- val clipboard = getTargetContext().getSystemService(Context .CLIPBOARD_SERVICE ) as ClipboardManager
201
+ val clipboard =
202
+ getTargetContext().getSystemService(Context .CLIPBOARD_SERVICE ) as ClipboardManager
202
203
val clip = ClipData .newPlainText(label, text)
203
204
clipboard.setPrimaryClip(clip)
204
205
}
205
206
}
206
207
207
208
protected fun checkClipboardText (text : CharSequence ) {
208
- val clipboardManager = getTargetContext().getSystemService(Context .CLIPBOARD_SERVICE ) as ClipboardManager
209
+ val clipboardManager =
210
+ getTargetContext().getSystemService(Context .CLIPBOARD_SERVICE ) as ClipboardManager
209
211
val primaryClip: ClipData ? = clipboardManager.primaryClip
210
212
211
213
var clipboardText: CharSequence? = null
@@ -239,14 +241,20 @@ abstract class BaseTest : BaseActivityTestImplementation {
239
241
return InstrumentationRegistry .getInstrumentation().context
240
242
}
241
243
242
- fun getMsgInfo (path : String , mimeMsgPath : String , vararg atts : AttachmentInfo ? ): IncomingMessageInfo ? {
244
+ fun getMsgInfo (
245
+ path : String ,
246
+ mimeMsgPath : String ,
247
+ vararg atts : AttachmentInfo ?
248
+ ): IncomingMessageInfo ? {
243
249
val incomingMsgInfo = TestGeneralUtil .getObjectFromJson(path, IncomingMessageInfo ::class .java)
244
250
incomingMsgInfo?.msgEntity?.let {
245
251
val uri = roomDatabase.msgDao().insert(it)
246
252
val attEntities = mutableListOf<AttachmentEntity >()
247
253
248
254
for (attInfo in atts) {
249
- attInfo?.let { info -> AttachmentEntity .fromAttInfo(info)?.let { candidate -> attEntities.add(candidate) } }
255
+ attInfo?.let { info ->
256
+ AttachmentEntity .fromAttInfo(info)?.let { candidate -> attEntities.add(candidate) }
257
+ }
250
258
}
251
259
252
260
roomDatabase.attachmentDao().insert(attEntities)
0 commit comments