Drive all levels through UI instrumentation
This commit is contained in:
@@ -25,6 +25,7 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Path
|
||||
import androidx.compose.ui.layout.boundsInRoot
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -51,7 +52,12 @@ fun ExercisePane(
|
||||
}
|
||||
SelectionContainer {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||
Text(level.title, style = MaterialTheme.typography.titleLarge, color = TextPrimary)
|
||||
Text(
|
||||
text = level.title,
|
||||
modifier = Modifier.testTag("exercise-title-${level.id}"),
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
color = TextPrimary,
|
||||
)
|
||||
Text(level.description, color = TextSecondary)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
@@ -33,7 +34,9 @@ fun LevelsPane(
|
||||
) {
|
||||
TextButton(
|
||||
onClick = { onSelect(index) },
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag("level-${level.id}"),
|
||||
colors = ButtonDefaults.textButtonColors(
|
||||
contentColor = if (index == currentLevelIndex) Accent else TextSecondary,
|
||||
),
|
||||
@@ -49,4 +52,4 @@ fun LevelsPane(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import androidx.compose.ui.input.key.key
|
||||
import androidx.compose.ui.input.key.onPreviewKeyEvent
|
||||
import androidx.compose.ui.input.key.type
|
||||
import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.TextRange
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
@@ -232,6 +233,7 @@ private fun RowScope.TerminalInputField(
|
||||
onValueChange = onValueChange,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.testTag("terminal-command-input")
|
||||
.focusRequester(focusRequester)
|
||||
.onFocusChanged { state ->
|
||||
if (state.isFocused) {
|
||||
|
||||
Reference in New Issue
Block a user