Skip to content

Commit

Permalink
ExplorationModel v1.4.1 added Interaction property to determine if a …
Browse files Browse the repository at this point in the history
…result screenshot was captured for this action
  • Loading branch information
Hotzkow committed Sep 4, 2019
1 parent 138b699 commit b33d537
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,35 @@ open class Interaction<out W: Widget> (
@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 = "") {

constructor(res: ActionResult, prevStateId: ConcreteId, resStateId: ConcreteId, target: W?)
: 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)


/**
Expand Down

0 comments on commit b33d537

Please sign in to comment.