mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Issue-5662-kotlinstyle (#5833)
* *.kt: bulk correction of formatting using ktlint --format * *.kt: replace wildcard imports and second stage auto format ktlint --format * QuizQuestionTest.kt: modified property names to camel case to meet ktlint standard * LevelControllerTest.kt: modified property names to camel case to meet ktlint standard * QuizActivityUnitTest.kt: modified property names to camel case to meet ktlint standard * MediaDetailFragmentUnitTests.kt: modified property names to camel case to meet ktlint standard * UploadWorker.kt: modified property names to camel case to meet ktlint standard * UploadClient.kt: modified property names to camel case to meet ktlint standard * BasePagingPresenter.kt: modified property names to camel case to meet ktlint standard * DescriptionEditActivity.kt: modified property names to camel case to meet ktlint standard * OnSwipeTouchListener.kt: modified property names to camel case to meet ktlint standard * MediaDetailFragmentUnitTests.kt: corrected excessive line length to meet ktlint standard * DepictedItem.kt: corrected property name format and catch format to for ktlint standard * UploadCategoryAdapter.kt: corrected class definition format to meet ktlint standard * CustomSelectorActivity.kt: reformatted function names to first letter lowercase to meet ktlint standard * MediaDetailFragmentUnitTests.kt: fix string literal indentation to meet ktlint standard * NotForUploadDao.kt: file renamed to match class name, new file NotForUploadStatusDao.kt * UploadedDao.kt: file renamed to match class name, new file UploadedStatusDao.kt * Urls.kt: fixed excessive line length for ktLint standard * Snak_partial.kt & Statement_partial.kt: refactored to remove underscores in class names to meet ktLint standard * *.kt: fixed consecutive KDOC error for ktLint * PageableBaseDataSourceTest.kt & UploadPresenterTest.kt: fixed excessive line lengths to meet ktLint standard * CheckboxTriStatesTest.kt: renamed file to match class name to meet ktLint standard * .kt: resolved backing-property-naming error in ktLint, made matching properties public, matched names and refactored * TestConnectionFactory.kt: fixed property naming to adhere to ktLint standard
This commit is contained in:
parent
950539c55c
commit
2d82a430c4
405 changed files with 11032 additions and 9137 deletions
|
|
@ -4,7 +4,10 @@ import android.app.Activity
|
|||
import android.app.Instrumentation
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.action.ViewActions.*
|
||||
import androidx.test.espresso.action.ViewActions.click
|
||||
import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
|
||||
import androidx.test.espresso.action.ViewActions.replaceText
|
||||
import androidx.test.espresso.action.ViewActions.scrollTo
|
||||
import androidx.test.espresso.contrib.RecyclerViewActions
|
||||
import androidx.test.espresso.intent.Intents
|
||||
import androidx.test.espresso.intent.matcher.IntentMatchers
|
||||
|
|
@ -28,7 +31,6 @@ import org.junit.runner.RunWith
|
|||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class UploadCancelledTest {
|
||||
|
||||
@Rule
|
||||
@JvmField
|
||||
var mActivityTestRule = ActivityTestRule(LoginActivity::class.java)
|
||||
|
|
@ -37,7 +39,7 @@ class UploadCancelledTest {
|
|||
@JvmField
|
||||
var mGrantPermissionRule: GrantPermissionRule =
|
||||
GrantPermissionRule.grant(
|
||||
"android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
"android.permission.WRITE_EXTERNAL_STORAGE",
|
||||
)
|
||||
|
||||
private val device: UiDevice =
|
||||
|
|
@ -48,14 +50,14 @@ class UploadCancelledTest {
|
|||
try {
|
||||
Intents.init()
|
||||
} catch (ex: IllegalStateException) {
|
||||
|
||||
}
|
||||
device.unfreezeRotation()
|
||||
device.setOrientationNatural()
|
||||
device.freezeRotation()
|
||||
UITestHelper.loginUser()
|
||||
UITestHelper.skipWelcome()
|
||||
Intents.intending(CoreMatchers.not(IntentMatchers.isInternal()))
|
||||
Intents
|
||||
.intending(CoreMatchers.not(IntentMatchers.isInternal()))
|
||||
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, null))
|
||||
}
|
||||
|
||||
|
|
@ -64,130 +66,137 @@ class UploadCancelledTest {
|
|||
try {
|
||||
Intents.release()
|
||||
} catch (ex: IllegalStateException) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun uploadCancelledAfterLocationPickedTest() {
|
||||
|
||||
val bottomNavigationItemView = onView(
|
||||
allOf(
|
||||
childAtPosition(
|
||||
val bottomNavigationItemView =
|
||||
onView(
|
||||
allOf(
|
||||
childAtPosition(
|
||||
withId(R.id.fragment_main_nav_tab_layout),
|
||||
0
|
||||
childAtPosition(
|
||||
withId(R.id.fragment_main_nav_tab_layout),
|
||||
0,
|
||||
),
|
||||
1,
|
||||
),
|
||||
1
|
||||
isDisplayed(),
|
||||
),
|
||||
isDisplayed()
|
||||
)
|
||||
)
|
||||
bottomNavigationItemView.perform(click())
|
||||
|
||||
UITestHelper.sleep(12000)
|
||||
|
||||
val actionMenuItemView = onView(
|
||||
allOf(
|
||||
withId(R.id.list_sheet),
|
||||
childAtPosition(
|
||||
val actionMenuItemView =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.list_sheet),
|
||||
childAtPosition(
|
||||
withId(R.id.toolbar),
|
||||
1
|
||||
childAtPosition(
|
||||
withId(R.id.toolbar),
|
||||
1,
|
||||
),
|
||||
0,
|
||||
),
|
||||
0
|
||||
isDisplayed(),
|
||||
),
|
||||
isDisplayed()
|
||||
)
|
||||
)
|
||||
actionMenuItemView.perform(click())
|
||||
|
||||
val recyclerView = onView(
|
||||
allOf(
|
||||
withId(R.id.rv_nearby_list),
|
||||
val recyclerView =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.rv_nearby_list),
|
||||
),
|
||||
)
|
||||
)
|
||||
recyclerView.perform(
|
||||
RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(
|
||||
0,
|
||||
click()
|
||||
)
|
||||
click(),
|
||||
),
|
||||
)
|
||||
|
||||
val linearLayout3 = onView(
|
||||
allOf(
|
||||
withId(R.id.cameraButton),
|
||||
childAtPosition(
|
||||
allOf(
|
||||
withId(R.id.nearby_button_layout),
|
||||
val linearLayout3 =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.cameraButton),
|
||||
childAtPosition(
|
||||
allOf(
|
||||
withId(R.id.nearby_button_layout),
|
||||
),
|
||||
0,
|
||||
),
|
||||
0
|
||||
isDisplayed(),
|
||||
),
|
||||
isDisplayed()
|
||||
)
|
||||
)
|
||||
linearLayout3.perform(click())
|
||||
|
||||
val pasteSensitiveTextInputEditText = onView(
|
||||
allOf(
|
||||
withId(R.id.caption_item_edit_text),
|
||||
childAtPosition(
|
||||
val pasteSensitiveTextInputEditText =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.caption_item_edit_text),
|
||||
childAtPosition(
|
||||
withId(R.id.caption_item_edit_text_input_layout),
|
||||
0
|
||||
childAtPosition(
|
||||
withId(R.id.caption_item_edit_text_input_layout),
|
||||
0,
|
||||
),
|
||||
0,
|
||||
),
|
||||
0
|
||||
isDisplayed(),
|
||||
),
|
||||
isDisplayed()
|
||||
)
|
||||
)
|
||||
pasteSensitiveTextInputEditText.perform(replaceText("test"), closeSoftKeyboard())
|
||||
|
||||
val pasteSensitiveTextInputEditText2 = onView(
|
||||
allOf(
|
||||
withId(R.id.description_item_edit_text),
|
||||
childAtPosition(
|
||||
val pasteSensitiveTextInputEditText2 =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.description_item_edit_text),
|
||||
childAtPosition(
|
||||
withId(R.id.description_item_edit_text_input_layout),
|
||||
0
|
||||
childAtPosition(
|
||||
withId(R.id.description_item_edit_text_input_layout),
|
||||
0,
|
||||
),
|
||||
0,
|
||||
),
|
||||
0
|
||||
isDisplayed(),
|
||||
),
|
||||
isDisplayed()
|
||||
)
|
||||
)
|
||||
pasteSensitiveTextInputEditText2.perform(replaceText("test"), closeSoftKeyboard())
|
||||
|
||||
val appCompatButton2 = onView(
|
||||
allOf(
|
||||
withId(R.id.btn_next),
|
||||
childAtPosition(
|
||||
val appCompatButton2 =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.btn_next),
|
||||
childAtPosition(
|
||||
withId(R.id.ll_container_media_detail),
|
||||
2
|
||||
childAtPosition(
|
||||
withId(R.id.ll_container_media_detail),
|
||||
2,
|
||||
),
|
||||
1,
|
||||
),
|
||||
1
|
||||
isDisplayed(),
|
||||
),
|
||||
isDisplayed()
|
||||
)
|
||||
)
|
||||
appCompatButton2.perform(click())
|
||||
|
||||
val appCompatButton3 = onView(
|
||||
allOf(
|
||||
withId(android.R.id.button1),
|
||||
val appCompatButton3 =
|
||||
onView(
|
||||
allOf(
|
||||
withId(android.R.id.button1),
|
||||
),
|
||||
)
|
||||
)
|
||||
appCompatButton3.perform(scrollTo(), click())
|
||||
|
||||
Intents.intended(IntentMatchers.hasComponent(LocationPickerActivity::class.java.name))
|
||||
|
||||
val floatingActionButton3 = onView(
|
||||
allOf(
|
||||
withId(R.id.location_chosen_button),
|
||||
isDisplayed()
|
||||
val floatingActionButton3 =
|
||||
onView(
|
||||
allOf(
|
||||
withId(R.id.location_chosen_button),
|
||||
isDisplayed(),
|
||||
),
|
||||
)
|
||||
)
|
||||
UITestHelper.sleep(2000)
|
||||
floatingActionButton3.perform(click())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue