Skip to content

Commit b33d537

Browse files
committed
ExplorationModel v1.4.1 added Interaction property to determine if a result screenshot was captured for this action
1 parent 138b699 commit b33d537

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2121

22-
version = "1.4.1-SNAPSHOT"
22+
version = "1.4.2"
2323

2424
plugins {
2525
id("org.jetbrains.kotlin.jvm") apply true

src/main/kotlin/org/droidmate/explorationModel/interaction/Interaction.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,35 @@ open class Interaction<out W: Widget> (
4545
@property:Persistent("Resulting State", 3, PType.ConcreteId) val resState: ConcreteId,
4646
@property:Persistent("Action-Id", 9, PType.Int) val actionId: Int,
4747
@property:Persistent("Data", 8) val data: String = "",
48+
@property:Persistent("HasResultScreen", 10) val hasResultScreenshot: Boolean = false,
4849
val deviceLogs: DeviceLogs = emptyList(),
4950
@Suppress("unused") val meta: String = "") {
5051

5152
constructor(res: ActionResult, prevStateId: ConcreteId, resStateId: ConcreteId, target: W?)
5253
: this(actionType = res.action.name, targetWidget = target,
5354
startTimestamp = res.startTimestamp, endTimestamp = res.endTimestamp, successful = res.successful,
5455
exception = res.exception, prevState = prevStateId, resState = resStateId, data = computeData(res.action),
55-
deviceLogs = res.deviceLogs, meta = res.action.id.toString(), actionId = res.action.id)
56+
deviceLogs = res.deviceLogs, meta = res.action.id.toString(), actionId = res.action.id, hasResultScreenshot = res.guiSnapshot.capturedScreen)
5657

5758
/** used for ActionQueue entries */
5859
constructor(action: ExplorationAction, res: ActionResult, prevStateId: ConcreteId, resStateId: ConcreteId, target: W?)
5960
: this(action.name, target, res.startTimestamp,
6061
res.endTimestamp, successful = res.successful, exception = res.exception, prevState = prevStateId,
61-
resState = resStateId, data = computeData(action), deviceLogs = res.deviceLogs, actionId = action.id)
62+
resState = resStateId, data = computeData(action), deviceLogs = res.deviceLogs, actionId = action.id, hasResultScreenshot = res.guiSnapshot.capturedScreen)
6263

6364
/** used for ActionQueue start/end Interaction */
6465
internal constructor(actionName:String, res: ActionResult, prevStateId: ConcreteId, resStateId: ConcreteId)
6566
: this(actionName, null, res.startTimestamp,
6667
res.endTimestamp, successful = res.successful, exception = res.exception, prevState = prevStateId,
67-
resState = resStateId, deviceLogs = res.deviceLogs, actionId = res.action.id)
68+
resState = resStateId, deviceLogs = res.deviceLogs, actionId = res.action.id, hasResultScreenshot = res.guiSnapshot.capturedScreen)
6869

6970
/** used for parsing from string */
7071
constructor(actionType: String, target: W?, startTimestamp: LocalDateTime, endTimestamp: LocalDateTime,
71-
successful: Boolean, exception: String, resState: ConcreteId, prevState: ConcreteId, data: String = "", actionId: Int)
72+
successful: Boolean, exception: String, resState: ConcreteId, prevState: ConcreteId, data: String = "",
73+
actionId: Int, hasResultScreenshot: Boolean = false)
7274
: this(actionType = actionType, targetWidget = target, startTimestamp = startTimestamp, endTimestamp = endTimestamp,
73-
successful = successful, exception = exception, prevState = prevState, resState = resState, data = data, actionId = actionId)
75+
successful = successful, exception = exception, prevState = prevState, resState = resState, data = data,
76+
actionId = actionId, hasResultScreenshot = hasResultScreenshot)
7477

7578

7679
/**

0 commit comments

Comments
 (0)