File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/e2etest Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11package cc.unitmesh.agent.e2etest.executor
22
33import cc.unitmesh.agent.e2etest.model.*
4- import kotlinx.datetime.Clock
54
65/* *
76 * WASM JS implementation of BrowserActionExecutor.
@@ -60,4 +59,7 @@ class WasmJsBrowserActionExecutor private constructor(
6059
6160actual fun createBrowserActionExecutor (config : BrowserExecutorConfig ): BrowserActionExecutor ? = null
6261
63- internal actual fun currentTimeMillis (): Long = Clock .System .now().toEpochMilliseconds()
62+ @JsFun(" () => Date.now()" )
63+ private external fun dateNow (): Double
64+
65+ internal actual fun currentTimeMillis (): Long = dateNow().toLong()
Original file line number Diff line number Diff line change 11package cc.unitmesh.agent.e2etest.perception
22
33import cc.unitmesh.agent.e2etest.model.*
4- import kotlinx.datetime.Clock
4+
5+ @JsFun(" () => Date.now()" )
6+ private external fun dateNow (): Double
57
68/* *
79 * WASM JS implementation of PageStateExtractor.
8- *
10+ *
911 * Uses browser APIs or Playwright MCP server.
10- *
12+ *
1113 * @see <a href="https://github.com/phodal/auto-dev/issues/532">Issue #532</a>
1214 */
1315actual interface PageStateExtractor {
@@ -31,16 +33,16 @@ actual interface PageStateExtractor {
3133class WasmJsPageStateExtractor (
3234 private val config : PageStateExtractorConfig
3335) : PageStateExtractor {
34-
36+
3537 override val isAvailable: Boolean = false
36-
38+
3739 override suspend fun extractPageState (): PageState {
3840 return PageState (
3941 url = " " ,
4042 title = " " ,
4143 viewport = Viewport (config.viewportWidth, config.viewportHeight),
4244 actionableElements = emptyList(),
43- capturedAt = Clock . System .now ().toEpochMilliseconds ()
45+ capturedAt = dateNow ().toLong ()
4446 )
4547 }
4648
You can’t perform that action at this time.
0 commit comments