diff --git a/sx/sx/applications/htmx/runner.sx b/sx/sx/applications/htmx/runner.sx index c0c8c8f4..99f53f26 100644 --- a/sx/sx/applications/htmx/runner.sx +++ b/sx/sx/applications/htmx/runner.sx @@ -108,24 +108,30 @@ (run-all (fn () + (console-log "[test] run-all start") (reset! running true) - (reset! results {}) + (reset! results {:empty true}) (for-each (fn (test) (let ((name (get test :name))) + (console-log (str "[test] === " name " ===")) (reset! current (str "Running: " name)) (reset! results (assoc (deref results) name "running")) + (console-log "[test] calling reload-frame") (reload-frame) + (console-log "[test] reload-frame done, running actions") (let - ((test-ok (cek-try (fn () (let ((actions (get test :actions))) (when (not (empty? actions)) (let ((first-sel (nth (first actions) 1))) (when (string? first-sel) (let ((found (wait-for-el first-sel 15))) (when (nil? found) (error (str "Timeout waiting for: " first-sel))))))) (for-each run-action actions)) true) (fn (e) (do (reset! results (assoc (deref results) name "fail")) (console-log (str "FAIL " name ": " e)) false))))) + ((test-ok (cek-try (fn () (let ((actions (get test :actions))) (when (not (empty? actions)) (let ((first-sel (nth (first actions) 1))) (when (string? first-sel) (console-log (str "[test] wait-for-el: " first-sel)) (let ((found (wait-for-el first-sel 15))) (when (nil? found) (error (str "Timeout waiting for: " first-sel))) (console-log (str "[test] found element: " first-sel)))))) (for-each run-action actions)) (console-log (str "[test] actions done for " name)) true) (fn (e) (do (reset! results (assoc (deref results) name "fail")) (console-log (str "[test] FAIL " name ": " e)) false))))) (when test-ok - (reset! results (assoc (deref results) name "pass")))))) + (reset! results (assoc (deref results) name "pass")) + (console-log (str "[test] PASS " name)))))) tests) (reset! running false) - (reset! current "Done")))) + (reset! current "Done") + (console-log "[test] run-all complete")))) (div (~tw :tokens "space-y-4") (div