user.clj 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. (ns user
  2. "fns used on repl"
  3. (:require [clojure.test :refer [run-tests run-test]]
  4. [logseq.e2e.editor-test]
  5. [logseq.e2e.fixtures :as fixtures]
  6. [logseq.e2e.outliner-test]
  7. [logseq.e2e.rtc-basic-test]
  8. [logseq.e2e.multi-tabs-test]
  9. [logseq.e2e.util :as util]
  10. [logseq.e2e.config :as config]
  11. [wally.main :as w]
  12. [wally.repl :as repl]))
  13. ;; Use port 3001 for local testing
  14. (reset! config/*port 3001)
  15. ;; show ui
  16. (reset! config/*headless false)
  17. (defn run-editor-test
  18. []
  19. (future (run-tests 'logseq.e2e.editor-test)))
  20. (defn run-outliner-test
  21. []
  22. (future (run-tests 'logseq.e2e.outliner-test)))
  23. (defn run-rtc-basic-test
  24. []
  25. (future (run-tests 'logseq.e2e.rtc-basic-test)))
  26. (defn run-multi-tabs-test
  27. []
  28. (future (run-tests 'logseq.e2e.multi-tabs-test)))
  29. (comment
  30. (future
  31. (fixtures/open-page
  32. repl/pause
  33. {:headless false}))
  34. ;; You can put `(repl/pause)` in any test to pause the tests,
  35. ;; this allows us to continue experimenting with the current page.
  36. (repl/pause)
  37. ;; To resume the tests, close the page/context/browser
  38. (repl/resume)
  39. ;; Run specific test
  40. (future (run-test logseq.e2e.editor-test/commands-test))
  41. ;; after the test has been paused, you can do anything with the current page like this
  42. (repl/with-page
  43. (w/wait-for (first (util/get-edit-block-container))
  44. {:state :detached}))
  45. ;;
  46. )