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)) {
|
if (!running and (tested.size == 0)) {
|
||||||
running = true
|
running = true
|
||||||
screenModel.init()
|
screenModel.init(actions)
|
||||||
}
|
}
|
||||||
|
|
||||||
when (val s = state) {
|
when (val s = state) {
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import cafe.adriel.voyager.core.model.StateScreenModel
|
|||||||
import cafe.adriel.voyager.core.model.screenModelScope
|
import cafe.adriel.voyager.core.model.screenModelScope
|
||||||
import io.anthonyberg.connector.shared.TestTransaction
|
import io.anthonyberg.connector.shared.TestTransaction
|
||||||
import io.anthonyberg.connector.shared.entity.Action
|
import io.anthonyberg.connector.shared.entity.Action
|
||||||
|
import io.anthonyberg.connector.shared.vdmj.VDMJTransaction
|
||||||
import io.anthonyberg.connector.shared.xpc.XPC
|
import io.anthonyberg.connector.shared.xpc.XPC
|
||||||
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@@ -14,11 +16,12 @@ class TestScreenModel (
|
|||||||
private val interfaceState: InterfaceState
|
private val interfaceState: InterfaceState
|
||||||
) : StateScreenModel<TestState>(TestState.Init) {
|
) : StateScreenModel<TestState>(TestState.Init) {
|
||||||
private val xpc = XPC()
|
private val xpc = XPC()
|
||||||
|
private val logger = KotlinLogging.logger {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up necessary connections
|
* Sets up necessary connections
|
||||||
*/
|
*/
|
||||||
fun init() {
|
fun init(actions: List<Action>) {
|
||||||
screenModelScope.launch {
|
screenModelScope.launch {
|
||||||
mutableState.value = TestState.Init
|
mutableState.value = TestState.Init
|
||||||
|
|
||||||
@@ -47,6 +50,11 @@ class TestScreenModel (
|
|||||||
xpc.setPOSI(posi)
|
xpc.setPOSI(posi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val vdm = VDMJTransaction(actions = actions, xpc = xpc)
|
||||||
|
val expected = vdm.expectedEndState()
|
||||||
|
|
||||||
|
logger.debug { expected }
|
||||||
|
|
||||||
delay(5000L)
|
delay(5000L)
|
||||||
|
|
||||||
// Starts the test in the database
|
// Starts the test in the database
|
||||||
|
|||||||
Reference in New Issue
Block a user