diff --git a/project/pcComponents/core/src/main/kotlin/org/droidmate/api/ExplorationAPI.kt b/project/pcComponents/core/src/main/kotlin/org/droidmate/api/ExplorationAPI.kt index d5e3755d..83d504ca 100644 --- a/project/pcComponents/core/src/main/kotlin/org/droidmate/api/ExplorationAPI.kt +++ b/project/pcComponents/core/src/main/kotlin/org/droidmate/api/ExplorationAPI.kt @@ -189,7 +189,7 @@ object ExplorationAPI { * Consequently the list of selectors is empty by default and if no watcher is specified the features listed in * [defaultReporter] are going to be used. */ - suspend fun, S: State,W: Widget> explore( + @JvmOverloads suspend fun, S: State,W: Widget> explore( cfg: ConfigurationWrapper, strategies: List, selectors: List = emptyList(), diff --git a/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/ExplorationContext.kt b/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/ExplorationContext.kt index 8452804e..c999514d 100644 --- a/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/ExplorationContext.kt +++ b/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/ExplorationContext.kt @@ -90,6 +90,7 @@ class ExplorationContext @JvmOverloads constructor(val cfg: Configuration init { debugOutput = model.config[debugMode] // disable debug outputs if not in debug mode measurePerformance = model.config[debugMode] + watcher.forEach { w -> if(w is ModelFeature) w.onAppExplorationStarted(this) } if (model.config[enableCoverage]){ val coverageDir = Paths.get(cfg[ConfigProperties.Output.outputDir].path).toAbsolutePath().resolve(cfg[coverageDir]).toAbsolutePath() val resourceDir = Paths.get(cfg[ConfigProperties.Output.outputDir].path).toAbsolutePath().resolve(EnvironmentConstants.dir_name_temp_extracted_resources).toAbsolutePath() diff --git a/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/strategy/manual/action/ImgUtils.kt b/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/strategy/manual/action/ImgUtils.kt index 45ceece1..61e1caa3 100644 --- a/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/strategy/manual/action/ImgUtils.kt +++ b/project/pcComponents/exploration/src/main/kotlin/org/droidmate/exploration/strategy/manual/action/ImgUtils.kt @@ -15,17 +15,23 @@ import java.awt.Color import java.awt.Font import java.awt.Graphics import java.io.File +import java.nio.file.Path import javax.imageio.ImageIO val log: Logger = getLogger("ImageUtils") -suspend fun showTargetsInImg(eContext: ExplorationContext<*,*,*>, toBeHighlighted: List, imgFile: File, autoGenScreen: Boolean = true) { +suspend fun showTargetsInImg( + eContext: ExplorationContext<*,*,*>, + toBeHighlighted: List, + imgFile: File, autoGenScreen: Boolean = true, + imgSrcDir: Path = eContext.model.config.imgDst +) { withContext(Dispatchers.IO) { val trace = eContext.explorationTrace // wait until file was pulled from device (done in ExploreCommand) eContext.imgTransfer.coroutineContext[Job]?.children?.forEach { it.join() } val filePath = if(autoGenScreen) - eContext.model.config.imgDst.resolve("${trace.last()?.actionId}.jpg").toString() + imgSrcDir.resolve("${trace.last()?.actionId}.jpg").toString() // the ExtendedTrace did not yet finish to move/ copy the file to the new location //trace.dstImgDir.resolve("${trace.interactions}.jpg").toString() else ""