Selenium easyb plugin - Use Selenium IDE generated code in your story

22 views
Skip to first unread message

Ludovic RONSIN

unread,
Nov 9, 2010, 12:20:58 PM11/9/10
to Easyb Users
I wanted to share a easier way of doing selenium test with easyb.
Normally, the groovy code generated by the Selenium IDE Firefox plugin
is meant to be used in a class extending GroovySeleneseTestCase.
This plugin allow you to use this generated code into your easyb story
with no modification.

Create the following file :

===== File : org/easyb/plugin/GroovySeleneseTestCasePlugin.groovy
=====

package org.easyb.plugin

import com.thoughtworks.selenium.GroovySeleneseTestCase;
import com.thoughtworks.selenium.SeleneseTestBase;
import org.easyb.plugin.BasePlugin

class GroovySeleneseTestCasePlugin extends BasePlugin {

static class EasyGroovySeleneseTestCase extends
GroovySeleneseTestCase {
@Lazy
selenium = super.selenium
}

String getName() {
"GroovySeleneseTestCase";
}

def beforeStory(Binding binding) {
Object.mixin EasyGroovySeleneseTestCase
}
}

==============================================================================

Then add this single line in the file META-INF/services/
org.easyb.plugin.EasybPlugin :
org.easyb.plugin.GroovySeleneseTestCasePlugin

And then in your story, just call the plugin with :

using "GroovySeleneseTestCase"

See http://code.google.com/p/easyb/wiki/PluginAPI for more info about
easyb plugin.

Enjoy! :)
Ludo.
Reply all
Reply to author
Forward
0 new messages