clojure@seleniumconf

9
September 11, 2014 Contents 1 First things first: what is Clojure? 2 2 Clojure Syntax 4 3 Dynamic Develoment 4 4 Functional Programming 4 5 Example 4 6 Example Cont. 5 7 Example Cont. 5 1

Upload: mayur-jadhav

Post on 22-May-2015

290 views

Category:

Technology


1 download

DESCRIPTION

Clojure for functional testing of mobile and web apps in seleniumConf14

TRANSCRIPT

Page 1: Clojure@seleniumconf

September 11, 2014

Contents

1 First things first: what is Clojure? 2

2 Clojure Syntax 4

3 Dynamic Develoment 4

4 Functional Programming 4

5 Example 4

6 Example Cont. 5

7 Example Cont. 5

1

Page 2: Clojure@seleniumconf

8 Example Cont. 5

9 Hosted on the JVM 5

10 Macros in Clojure 6

11 Clj-webdriver 6

12 calabash-clj 6

13 appium-clj 7

14 Demo 8

15 Any Questions? 9

1 First things first: what is Clojure?

• Invented in 2007 by

2

Page 3: Clojure@seleniumconf

Rich Hickey

• Dynamic, functional programming language

• Lisp for JVM

3

Page 4: Clojure@seleniumconf

2 Clojure Syntax

3 Dynamic Develoment

4 Functional Programming

• Functions as first-class objects

• Feedback loop is fast

5 Example

4

Page 5: Clojure@seleniumconf

6 Example Cont.

7 Example Cont.

8 Example Cont.

9 Hosted on the JVM

• Designed to be hosted (JVM, V8, CLR, Python, LLVM, etc)

• Great java library consumer

• Java invocation syntax is clean and simple Ex.:

5

Page 6: Clojure@seleniumconf

-> (. Classname-symbol method-symbol args*)-> (.instanceMember Classname args*)

10 Macros in Clojure

• Macros gives clojure great power.

• Difference between functions and macros

• Writing control flow macro

11 Clj-webdriver

• Clojure API for selenium webdriver

• https://github.com/semperos/clj-webdriver

• Clojars https://clojars.org/me.kapilreddy/clj-webdriver

• Features

• Demo link: https://www.youtube.com/watch?v=Zje19PkLbYk&feature=youtu.be

12 calabash-clj

• Clojure API for Android

• https://github.com/kapilreddy/calabash-clj

6

Page 7: Clojure@seleniumconf

Kapil Reddy [Helpshift]

• Demo link: https://www.youtube.com/watch?v=NY6aQh0lf8M&feature=youtu.be

13 appium-clj

• Clojure API for appium-java-client

• https://github.com/helpshift/appium-clj-client

7

Page 8: Clojure@seleniumconf

Mayur Jadhav

• Demo link: https://www.youtube.com/watch?v=eGcEWKZEZ9c&feature=youtu.be

14 Demo

• Demo link: https://www.youtube.com/watch?v=mO-vAMy0Ack&feature=youtu.be

8

Page 9: Clojure@seleniumconf

15 Any Questions?

9