mirror of
https://github.com/logseq/logseq.git
synced 2026-04-25 22:54:48 +00:00
70 lines
1.8 KiB
Clojure
70 lines
1.8 KiB
Clojure
(ns user
|
|
"fns used on repl"
|
|
(:require [clojure.test :refer [run-tests run-test]]
|
|
[logseq.e2e.config :as config]
|
|
[logseq.e2e.editor-test]
|
|
[logseq.e2e.fixtures :as fixtures]
|
|
[logseq.e2e.multi-tabs-test]
|
|
[logseq.e2e.outliner-test]
|
|
[logseq.e2e.rtc-basic-test]
|
|
[logseq.e2e.util :as util]
|
|
[wally.main :as w]
|
|
[wally.repl :as repl]))
|
|
|
|
;; Use port 3001 for local testing
|
|
(reset! config/*port 3001)
|
|
;; show ui
|
|
(reset! config/*headless false)
|
|
|
|
(def *futures (atom {}))
|
|
|
|
(defn cancel
|
|
[test-name]
|
|
(some-> (get @*futures test-name) future-cancel)
|
|
(swap! *futures dissoc test-name))
|
|
|
|
(defn run-editor-test
|
|
[]
|
|
(->> (future (run-tests 'logseq.e2e.editor-test))
|
|
(swap! *futures assoc :editor-test)))
|
|
|
|
(defn run-outliner-test
|
|
[]
|
|
(->> (future (run-tests 'logseq.e2e.outliner-test))
|
|
(swap! *futures assoc :outliner-test)))
|
|
|
|
(defn run-rtc-basic-test
|
|
[]
|
|
(->> (future (run-tests 'logseq.e2e.rtc-basic-test))
|
|
(swap! *futures assoc :rtc-basic-test)))
|
|
|
|
(defn run-multi-tabs-test
|
|
[]
|
|
(->> (future (run-tests 'logseq.e2e.multi-tabs-test))
|
|
(swap! *futures assoc :multi-tabs-test)))
|
|
|
|
(comment
|
|
|
|
(future
|
|
(fixtures/open-page
|
|
repl/pause
|
|
{:headless false}))
|
|
|
|
;; You can put `(repl/pause)` in any test to pause the tests,
|
|
;; this allows us to continue experimenting with the current page.
|
|
(repl/pause)
|
|
|
|
;; To resume the tests, close the page/context/browser
|
|
(repl/resume)
|
|
|
|
;; Run specific test
|
|
(future (run-test logseq.e2e.editor-test/commands-test))
|
|
|
|
;; after the test has been paused, you can do anything with the current page like this
|
|
(repl/with-page
|
|
(w/wait-for (first (util/get-edit-block-container))
|
|
{:state :detached}))
|
|
|
|
;;
|
|
)
|