Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Clojure UI testing with Chrome

License

NotificationsYou must be signed in to change notification settings

milankinen/cuic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CUIC

Clojure UI testing with Chrome. Special thanks to Timo L. for the awesome logo!

Build statusClojars Projectcljdoc

Motivation

I needed a library for writing robust and maintainable UI tests for my workand hobby Clojure(Script) projects. The library had to run on top of theJVM to simplify test setups and enable code sharing, but without theannoying WebDriver version hassle.cuic is a response to fill that gap.

The design of the current version ofcuic is the result of countless(re)written tests, hours after hours of CI test runs and endless debuggingsessions, driven by the following core principles:

  • Prefer Clojure core data structures and language featuresto custom macros and DSLs
  • Minimal and unambiguous but easily extendable API
  • Seamless integration withclojure.test and the tooling around it
  • First class REPL usage

Show me the code!

Here's a small snippet showing how to test the classicTodoMVC app withcuic

(nsexample-todomvc-tests  (:require [clojure.test:refer:all]            [cuic.core:as c]            [cuic.test:refer [deftest* is* browser-test-fixture]]))(use-fixtures:once  (browser-test-fixture))(defntodos []  (->> (c/query".todo-list li")       (map c/text-content)))(defnadd-todo [text]  (doto (c/find".new-todo")    (c/fill text))  (c/press 'Enter))(deftest*creating-new-todos  (c/goto"http://todomvc.com/examples/react")  (is* (= [] (todos)))  (add-todo"Hello world!")  (is* (= ["Hello world!"] (todos)))  (add-todo"Tsers!")  (is* (= ["Hello world!""Tsers!"] (todos))))

Documentation

Eachcuic function has a Clojure doc-string describing its behaviour and usage.Generated API docs and guides are also available incljdoc.org.

Similar projects

License

MIT


[8]ページ先頭

©2009-2025 Movatter.jp