From b33d537d21fee2af324bbb6648f7b9fda267c694 Mon Sep 17 00:00:00 2001 From: "J.H" Date: Wed, 4 Sep 2019 15:58:11 +0200 Subject: [PATCH] ExplorationModel v1.4.1 added Interaction property to determine if a result screenshot was captured for this action --- build.gradle.kts | 2 +- .../explorationModel/interaction/Interaction.kt | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b8943bf..7a56b22 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -version = "1.4.1-SNAPSHOT" +version = "1.4.2" plugins { id("org.jetbrains.kotlin.jvm") apply true diff --git a/src/main/kotlin/org/droidmate/explorationModel/interaction/Interaction.kt b/src/main/kotlin/org/droidmate/explorationModel/interaction/Interaction.kt index 320a142..a674de3 100644 --- a/src/main/kotlin/org/droidmate/explorationModel/interaction/Interaction.kt +++ b/src/main/kotlin/org/droidmate/explorationModel/interaction/Interaction.kt @@ -45,6 +45,7 @@ open class Interaction ( @property:Persistent("Resulting State", 3, PType.ConcreteId) val resState: ConcreteId, @property:Persistent("Action-Id", 9, PType.Int) val actionId: Int, @property:Persistent("Data", 8) val data: String = "", + @property:Persistent("HasResultScreen", 10) val hasResultScreenshot: Boolean = false, val deviceLogs: DeviceLogs = emptyList(), @Suppress("unused") val meta: String = "") { @@ -52,25 +53,27 @@ open class Interaction ( : this(actionType = res.action.name, targetWidget = target, startTimestamp = res.startTimestamp, endTimestamp = res.endTimestamp, successful = res.successful, exception = res.exception, prevState = prevStateId, resState = resStateId, data = computeData(res.action), - deviceLogs = res.deviceLogs, meta = res.action.id.toString(), actionId = res.action.id) + deviceLogs = res.deviceLogs, meta = res.action.id.toString(), actionId = res.action.id, hasResultScreenshot = res.guiSnapshot.capturedScreen) /** used for ActionQueue entries */ constructor(action: ExplorationAction, res: ActionResult, prevStateId: ConcreteId, resStateId: ConcreteId, target: W?) : this(action.name, target, res.startTimestamp, res.endTimestamp, successful = res.successful, exception = res.exception, prevState = prevStateId, - resState = resStateId, data = computeData(action), deviceLogs = res.deviceLogs, actionId = action.id) + resState = resStateId, data = computeData(action), deviceLogs = res.deviceLogs, actionId = action.id, hasResultScreenshot = res.guiSnapshot.capturedScreen) /** used for ActionQueue start/end Interaction */ internal constructor(actionName:String, res: ActionResult, prevStateId: ConcreteId, resStateId: ConcreteId) : this(actionName, null, res.startTimestamp, res.endTimestamp, successful = res.successful, exception = res.exception, prevState = prevStateId, - resState = resStateId, deviceLogs = res.deviceLogs, actionId = res.action.id) + resState = resStateId, deviceLogs = res.deviceLogs, actionId = res.action.id, hasResultScreenshot = res.guiSnapshot.capturedScreen) /** used for parsing from string */ constructor(actionType: String, target: W?, startTimestamp: LocalDateTime, endTimestamp: LocalDateTime, - successful: Boolean, exception: String, resState: ConcreteId, prevState: ConcreteId, data: String = "", actionId: Int) + successful: Boolean, exception: String, resState: ConcreteId, prevState: ConcreteId, data: String = "", + actionId: Int, hasResultScreenshot: Boolean = false) : this(actionType = actionType, targetWidget = target, startTimestamp = startTimestamp, endTimestamp = endTimestamp, - successful = successful, exception = exception, prevState = prevState, resState = resState, data = data, actionId = actionId) + successful = successful, exception = exception, prevState = prevState, resState = resState, data = data, + actionId = actionId, hasResultScreenshot = hasResultScreenshot) /**