Skip to content
Joseph Spencer edited this page Jul 26, 2014 · 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

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