Skip to content

Instantly share code, notes, and snippets.

@kevinah95
Last active May 6, 2025 03:03
Show Gist options
  • Save kevinah95/3aeb72d6595c29d2ddb76c23b4048740 to your computer and use it in GitHub Desktop.
Save kevinah95/3aeb72d6595c29d2ddb76c23b4048740 to your computer and use it in GitHub Desktop.
package io.github.kevinah95.unit01.l02_repaso
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
import org.junit.Rule
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@get:Rule val composeTestRule = createAndroidComposeRule<MainActivity>()
@Test
fun testGreeting() {
composeTestRule.onNode(hasTestTag("greeting_text")).assertIsDisplayed()
}
}
package io.github.kevinah95.unit01.l02_repaso
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import io.github.kevinah95.unit01.l02_repaso.ui.theme.L02repasoTheme
class ExampleScreenshotTest {
@Preview
@Composable
fun GreetingPreview(){
L02repasoTheme {
GreetingImage(message = "Happy Birthday Kevin!", from = "— From Jenni")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment