File tree 3 files changed +20
-2
lines changed
androidTest/java/ytemplate/android/feature/post/ui
main/java/ytemplate/android/feature/post/ui
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
10
10
- ` <application_name> ` Optional input.
11
11
- ` ./YTemplate.sh <package_name> <application_name> ` .
12
12
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 ) .
14
14
Type ` bash YTemplate.sh <package_name> <application_name> ` . It will execute the script.
15
15
16
16
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import androidx.compose.ui.test.assertIsDisplayed
5
5
import androidx.compose.ui.test.junit4.createComposeRule
6
6
import androidx.compose.ui.test.onNodeWithTag
7
7
import androidx.compose.ui.test.performClick
8
+ import androidx.compose.ui.test.performTextInput
8
9
import org.junit.Rule
9
10
import org.junit.Test
10
11
import ytemplate.android.core.ui.theme.YTemplateTheme
@@ -28,4 +29,21 @@ class TestNewLocalPostScreen {
28
29
composeTestRule.onNodeWithTag(" show_new_post_button" ).performClick()
29
30
composeTestRule.onNodeWithTag(" title_tag" ).assertIsDisplayed()
30
31
}
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
+ }
31
49
}
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ fun ShowNewPostScreen(
94
94
var title by remember { mutableStateOf(" " ) }
95
95
var details by remember { mutableStateOf(" " ) }
96
96
Column (modifier = modifier) {
97
- Box (modifier = Modifier .fillMaxWidth().padding(dimensions.paddingSmall)) {
97
+ Box (modifier = Modifier .fillMaxWidth().padding(dimensions.paddingSmall).testTag( " new_post_title " ) ) {
98
98
Text (
99
99
modifier = Modifier .align(Alignment .CenterStart ),
100
100
text = stringResource(R .string.new_post),
You can’t perform that action at this time.
0 commit comments