Merge pull request #1308 from vector-im/feature/fixMaestro

Fix Maestro test.
This commit is contained in:
Benoit Marty 2023-09-14 11:30:21 +02:00 committed by GitHub
commit 206579e647
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 31 additions and 23 deletions

View file

@ -26,9 +26,7 @@ import androidx.compose.ui.semantics.testTagsAsResourceId
* Add a testTag to a Modifier, to be used by external tool, like TrafficLight for instance.
*/
@OptIn(ExperimentalComposeUiApi::class)
fun Modifier.testTag(id: TestTag) = this.then(
semantics {
testTag = id.value
testTagsAsResourceId = true
}
)
fun Modifier.testTag(id: TestTag) = semantics {
testTag = id.value
testTagsAsResourceId = true
}

View file

@ -47,6 +47,11 @@ object TestTags {
* Welcome screen.
*/
val welcomeScreenTitle = TestTag("welcome_screen-title")
/**
* RichTextEditor.
*/
val richTextEditor = TestTag("rich_text_editor")
}

View file

@ -31,6 +31,7 @@ dependencies {
implementation(projects.libraries.matrix.api)
implementation(projects.libraries.matrixui)
implementation(projects.libraries.designsystem)
implementation(projects.libraries.testtags)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.constraintlayout.compose)

View file

@ -74,6 +74,8 @@ import io.element.android.libraries.matrix.api.media.MediaSource
import io.element.android.libraries.matrix.ui.components.AttachmentThumbnail
import io.element.android.libraries.matrix.ui.components.AttachmentThumbnailInfo
import io.element.android.libraries.matrix.ui.components.AttachmentThumbnailType
import io.element.android.libraries.testtags.TestTags
import io.element.android.libraries.testtags.testTag
import io.element.android.libraries.textcomposer.components.FormattingOption
import io.element.android.libraries.textcomposer.components.FormattingOptionState
import io.element.android.libraries.theme.ElementTheme
@ -255,7 +257,8 @@ private fun TextInput(
start = 12.dp.applyScaleUp(),
end = 42.dp.applyScaleUp()
)
),
)
.testTag(TestTags.richTextEditor),
contentAlignment = Alignment.CenterStart,
) {