File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
androidTest/java/ytemplate/android/feature/post/ui
main/java/ytemplate/android/feature/post/ui Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ The project includes a shell script file `YTemplate.sh` which renames and restru
1010 - ` <application_name> ` Optional input.
1111 - ` ./YTemplate.sh <package_name> <application_name> ` .
1212
13- Note: To run the shell script on Windows, one can run bash on ubuntu in Windows(starting from Windows 10).
13+ Note: To run the shell script on Windows, one can run bash on ubuntu in Windows(starting from Windows 10) or GitWindows( https://git-scm.com/download/win ) .
1414Type ` bash YTemplate.sh <package_name> <application_name> ` . It will execute the script.
1515
1616
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import androidx.compose.ui.test.assertIsDisplayed
55import androidx.compose.ui.test.junit4.createComposeRule
66import androidx.compose.ui.test.onNodeWithTag
77import androidx.compose.ui.test.performClick
8+ import androidx.compose.ui.test.performTextInput
89import org.junit.Rule
910import org.junit.Test
1011import ytemplate.android.core.ui.theme.YTemplateTheme
@@ -28,4 +29,21 @@ class TestNewLocalPostScreen {
2829 composeTestRule.onNodeWithTag(" show_new_post_button" ).performClick()
2930 composeTestRule.onNodeWithTag(" title_tag" ).assertIsDisplayed()
3031 }
32+
33+ @Test
34+ fun testCreateNewPost (){
35+ composeTestRule.setContent {
36+ YTemplateTheme {
37+ ShowCreatePostOption (Modifier ) {
38+ }
39+ }
40+ }
41+
42+ composeTestRule.onNodeWithTag(" show_new_post_button" ).assertIsDisplayed()
43+ composeTestRule.onNodeWithTag(" show_new_post_button" ).performClick()
44+ composeTestRule.onNodeWithTag(" new_post_title" ).assertIsDisplayed()
45+ composeTestRule.onNodeWithTag(" title_tag" ).performTextInput(" TestTitle" )
46+ composeTestRule.onNodeWithTag(" details_tag" ).performTextInput(" TestDetails" )
47+ composeTestRule.onNodeWithTag(" add_button" ).performClick()
48+ }
3149}
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ fun ShowNewPostScreen(
9494 var title by remember { mutableStateOf(" " ) }
9595 var details by remember { mutableStateOf(" " ) }
9696 Column (modifier = modifier) {
97- Box (modifier = Modifier .fillMaxWidth().padding(dimensions.paddingSmall)) {
97+ Box (modifier = Modifier .fillMaxWidth().padding(dimensions.paddingSmall).testTag( " new_post_title " ) ) {
9898 Text (
9999 modifier = Modifier .align(Alignment .CenterStart ),
100100 text = stringResource(R .string.new_post),
You can’t perform that action at this time.
0 commit comments