mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-11-30 01:39:38 +01:00
feat(connector): add VDMJ into Test
This commit is contained in:
@@ -38,7 +38,7 @@ class TestRun (
|
||||
|
||||
if (!running and (tested.size == 0)) {
|
||||
running = true
|
||||
screenModel.init()
|
||||
screenModel.init(actions)
|
||||
}
|
||||
|
||||
when (val s = state) {
|
||||
|
||||
@@ -5,7 +5,9 @@ import cafe.adriel.voyager.core.model.StateScreenModel
|
||||
import cafe.adriel.voyager.core.model.screenModelScope
|
||||
import io.anthonyberg.connector.shared.TestTransaction
|
||||
import io.anthonyberg.connector.shared.entity.Action
|
||||
import io.anthonyberg.connector.shared.vdmj.VDMJTransaction
|
||||
import io.anthonyberg.connector.shared.xpc.XPC
|
||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -14,11 +16,12 @@ class TestScreenModel (
|
||||
private val interfaceState: InterfaceState
|
||||
) : StateScreenModel<TestState>(TestState.Init) {
|
||||
private val xpc = XPC()
|
||||
private val logger = KotlinLogging.logger {}
|
||||
|
||||
/**
|
||||
* Sets up necessary connections
|
||||
*/
|
||||
fun init() {
|
||||
fun init(actions: List<Action>) {
|
||||
screenModelScope.launch {
|
||||
mutableState.value = TestState.Init
|
||||
|
||||
@@ -47,6 +50,11 @@ class TestScreenModel (
|
||||
xpc.setPOSI(posi)
|
||||
}
|
||||
|
||||
val vdm = VDMJTransaction(actions = actions, xpc = xpc)
|
||||
val expected = vdm.expectedEndState()
|
||||
|
||||
logger.debug { expected }
|
||||
|
||||
delay(5000L)
|
||||
|
||||
// Starts the test in the database
|
||||
|
||||
Reference in New Issue
Block a user