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.