Liking cljdoc? Tell your friends :D

com.blockether.spel.allure-ct-reporter

Global clojure.test Allure reporter via defmethod hooks.

Activated by system property or env var:

-Dallure.clojure-test.enabled=true ALLURE_CLOJURE_TEST_ENABLED=true

Once activated, ALL clojure.test runs automatically produce Allure results — works with any test runner (Kaocha, Cognitect test-runner, plain clojure.test/run-tests, REPL).

The defmethod overrides chain the original clojure.test handlers so standard test output is preserved. Our handlers run additionally when enabled. When disabled (default), zero overhead — just a nil check.

In test namespaces:

(ns my-app.test (:require [clojure.test :refer [deftest testing is use-fixtures]] [com.blockether.spel.allure :as allure] [com.blockether.spel.test-fixtures :refer [page with-playwright with-browser with-traced-page ct-fixture]]))

(use-fixtures :once (ct-fixture with-playwright) (ct-fixture with-browser)) (use-fixtures :each (ct-fixture with-traced-page))

(deftest my-test (allure/epic "My Epic") (testing "something" (is (= 1 1))))

with-allure-context is auto-injected as the outermost :each fixture for every namespace — test files never reference it.

Configuration (system properties / env vars):

PropertyEnv VarDefault
allure.clojure-test.enabledALLURE_CLOJURE_TEST_ENABLEDfalse
allure.clojure-test.outputALLURE_CLOJURE_TEST_OUTPUTallure-results
allure.clojure-test.reportALLURE_CLOJURE_TEST_REPORTtrue
allure.clojure-test.cleanALLURE_CLOJURE_TEST_CLEANtrue
Global clojure.test Allure reporter via defmethod hooks.

Activated by system property or env var:

  -Dallure.clojure-test.enabled=true
  ALLURE_CLOJURE_TEST_ENABLED=true

Once activated, ALL clojure.test runs automatically produce Allure
results — works with any test runner (Kaocha, Cognitect test-runner,
plain clojure.test/run-tests, REPL).

The defmethod overrides chain the original clojure.test handlers so
standard test output is preserved. Our handlers run additionally when
enabled. When disabled (default), zero overhead — just a nil check.

In test namespaces:

  (ns my-app.test
    (:require
     [clojure.test :refer [deftest testing is use-fixtures]]
     [com.blockether.spel.allure :as allure]
     [com.blockether.spel.test-fixtures
      :refer [*page* with-playwright with-browser with-traced-page ct-fixture]]))

  (use-fixtures :once (ct-fixture with-playwright) (ct-fixture with-browser))
  (use-fixtures :each (ct-fixture with-traced-page))

  (deftest my-test
    (allure/epic "My Epic")
    (testing "something"
      (is (= 1 1))))

`with-allure-context` is auto-injected as the outermost :each fixture
for every namespace — test files never reference it.

Configuration (system properties / env vars):

| Property                         | Env Var                        | Default          |
|----------------------------------|--------------------------------|------------------|
| allure.clojure-test.enabled      | ALLURE_CLOJURE_TEST_ENABLED    | false            |
| allure.clojure-test.output       | ALLURE_CLOJURE_TEST_OUTPUT     | allure-results   |
| allure.clojure-test.report       | ALLURE_CLOJURE_TEST_REPORT     | true             |
| allure.clojure-test.clean        | ALLURE_CLOJURE_TEST_CLEAN      | true             |
raw docstring

enabled?clj

(enabled?)

Check if the clojure.test Allure reporter is enabled.

Check if the clojure.test Allure reporter is enabled.
sourceraw docstring

with-allure-contextclj

(with-allure-context f)

clojure.test :each fixture that binds the Allure in-test API context.

Enables allure/step, allure/epic, allure/screenshot, etc. within clojure.test deftest blocks. Also captures stdout/stderr per test.

Auto-injected as the OUTERMOST :each fixture by the global reporter hooks — test files never reference this directly.

Being outermost is critical: inner fixtures (e.g. with-traced-page) tear down BEFORE this fixture's post-(f) code runs, so trace/HAR files are fully written by the time we copy them into allure-results.

clojure.test :each fixture that binds the Allure in-test API context.

Enables allure/step, allure/epic, allure/screenshot, etc. within
clojure.test deftest blocks. Also captures stdout/stderr per test.

Auto-injected as the OUTERMOST :each fixture by the global reporter
hooks — test files never reference this directly.

Being outermost is critical: inner fixtures (e.g. with-traced-page)
tear down BEFORE this fixture's post-`(f)` code runs, so trace/HAR
files are fully written by the time we copy them into allure-results.
sourceraw docstring

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