UI Automation for OS X
AXElements is a UI automation library built on top of various OS X Frameworks. You can use AXElements to write functional tests for Cocoa apps, script UI interactions, or even to build higher level tools such as screen readers.
AXElements includes a DSL that allows code to be written in a very natural and declarative style that describes user interactions, but also exposes an OO interface.
Follow the instructions in the README on Github