Skip to content

Instantly share code, notes, and snippets.

@Yougin
Yougin / DslForUiTests.kt
Last active October 5, 2022 11:51
DSL for UI tests with faked data
/** This is a part of my pet project where I use DSL for making UI tests with faked data (swapped at runtime)
Back in 2017 we couldn't use spaces in function names :)
Inspired by the guru man https://jakewharton.com/testing-robots/
*/
@RunWith(AndroidJUnit4::class) class CatalogsScreenTest {
@Inject lateinit var catalogsRobot: CatalogsRobot
@Inject lateinit var catalogsRepository: CatalogRepository
fun givenCatalogsScreen(func: CatalogsRobot.() -> Unit) = catalogsRobot.apply { func() }
alias gits='git status'
alias gitc='git commit -m'
alias gitca='git commit --amend'
alias gitf='git fetch -v'
alias gitl='git log --graph --oneline --date-order --decorate --color'
alias grh='git reset --hard'
alias gs='./gradlew --stop'
# Attach a debuger. Append it with the package name.
@Yougin
Yougin / gist:d33345377c9148030598e807462737f2
Created March 15, 2017 16:51
Attach debugger restoring the app from a killed state
adb shell am set-debug-app -w --persistent your.app.package