Skip to content
Abhijit Gaikwad edited this page Mar 29, 2015 · 4 revisions

By using include in our spun files, we're able to re-use common steps within our spun files.

Consider the common use case of signing into a form. For this we could create a sign-in.spun file and include it within our test cases.

Example

google.spun

get "http://google.com"
type "spun authoring" in "[name=q]"
submit
find "#search li h3"
assert "spun" in text
quit

sign-in.spun

find "form#login"
type "username" in "input[name=username]"
type "password" in "input[name=password]"
submit

some-test-case1.spun

include "./sign-in.spun`
#do something signed in

some-test-case2.spun

include "./sign-in.spun`
#do something signed in
Clone this wiki locally