              (try
                (q/background 255)
                (body)
-               (if (imagemagick-installed?)
                  (assert-unchanged-snippet-output name)
-                 (println "Imagemagick not detected. Please install it for automated image comparison to work."))
                (catch Exception e
                  (println "Error" e)
                  (.printStackTrace e)

            (etaoin/refresh driver)
            (etaoin/screenshot-element driver {:tag :canvas} actual)
            (let [result (compare-images expected actual difference)]
              (when (<= result threshold)
                (io/delete-file (io/file actual))
                (io/delete-file (io/file difference)))
              (t/is (<= result threshold)
                    (str "Image comparison for " name " not within acceptable threshold: " threshold)))))))
    (etaoin/quit driver)))

          difference (replace-suffix expected "difference")
          result     (compare-images expected actual difference)
          threshold  0.02]
      (when (number? result)
        (when (<= result threshold)
          (io/delete-file (io/file actual))
          (io/delete-file (io/file difference)))
        (t/is (<= result threshold))))))

(defn run-snippet-as-test [{:keys [ns name opts setup body body-str mouse-clicked]}]
  (let [result (promise)
