Liking cljdoc? Tell your friends :D

cuic.test


*screenshot-dir*clj

Root directory where screenshots will be saved on failed tests. Set this to nil in order to disable screenshots.

Root directory where screenshots will be saved on failed tests.
Set this to `nil` in order to disable screenshots.
sourceraw docstring

*snapshot-dir*clj

Root directory for saved snapshots from matches-snapshot?

Root directory for saved snapshots from `matches-snapshot?`
sourceraw docstring

__cuic-internal-assert-snapshot__clj

(__cuic-internal-assert-snapshot__ msg [_ id actual])
source

__cuic-internal-try-take-screenshot__clj

(__cuic-internal-try-take-screenshot__)
source

actual-fileclj

(actual-file id ext)
source

deftest*cljmacro

(deftest* name & body)

Macro that works like deftest from clojure.test. It also surrounds the test body with try-catch block which captures all thrown CUIC exceptions and failed is* assertions and tries to take a screenshot from the current browser window for further inspection.

Macro that works like `deftest` from `clojure.test`. It also surrounds
the test body with try-catch block which captures all thrown CUIC exceptions
and failed `is*` assertions and tries to take a screenshot from the current
browser window for further inspection.
sourceraw docstring

expected-fileclj

(expected-file id ext)
source

is*cljmacro

(is* form)

Assertion macro that works like is from clojure.test with two differences:

  • If asserted form returns non-truthy value it will automatically be retried until truthy value is received or timeout exceeds (implicit c/wait)
  • If assertion fails or errors is throw from the assertion, cuic.AbortTestError is throw, indicating that test should be aborted immediately without evaluating any further steps.

Normally you should pair this macro with CUIC's deftest* to get screenshot from the failed page and to suppress extra errors caused by default clojure.test test reporter.

Assertion macro that works like `is` from `clojure.test` with two differences:

 * If asserted form returns non-truthy value it will automatically be retried
   until truthy value is received or timeout exceeds (implicit `c/wait`)
 * If assertion fails or errors is throw from the assertion,
   `cuic.AbortTestError` is throw, indicating that test should be aborted
   immediately without evaluating any further steps.

Normally you should pair this macro with CUIC's `deftest*` to get screenshot from
the failed page and to suppress extra errors caused by default `clojure.test` test
reporter.
sourceraw docstring

matches-snapshot?clj

(matches-snapshot? snapshot-id actual)

Tries to match the given actual data to the snapshot associated to the given id (keyword). If snapshot does not exist, this function creates it. All data that can be serialized with pr-str can be tested with snapshot testing.

Hint: Use fully qualified keyword to distinguish snapshots from different test namespaces. You can also share same snapshots by using same id.

Tries to match the given actual data to the snapshot associated to the
given id (keyword). If snapshot does not exist, this function creates it.
All data that can be serialized with `pr-str` can be tested with snapshot
testing.

**Hint:** Use fully qualified keyword to distinguish snapshots from different
test namespaces. You can also share same snapshots by using same id.
sourceraw docstring

read-ednclj

(read-edn f)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close