I've been spending some quality time with selenium-tests lately.

I find it useful and like it overall, but one thing that I'm not too crazy about is cucumber.

IMO, the benefit of human-readable test case doesn't justify the mainly cognitive cost of all the regular expression matching and jumping back and forth between step definitions.

Gherkin feels a bit like Logo [1] without variables. Whenever steps need to interact with each other it needs to pass everything implicitly back into the instance variables of test scenario, and it generally creates a mess.

Every step relying on single object that captures all the test state means I can't handle multiple things simultaneously very well either --- like if I want to do something with two jobs, or two interacting Jenkins instances.

I'd rather see the tests written in ruby --- I find it just as readable and more precise on what it does.

So I added a bit of glue and ported one of the Ant plugin test to rspec [2]:

require 'spec_helper'

Jenkins.rspec "Ant plugin" do
  it 'allows users to use Ant in a freestyle project' do
    @jenkins.plugin_manager.install_plugin! 'ant'
    j = @jenkins.create_job('FreeStyle')
    j.configure do
      j.add_create_file_step('build.xml',<<eos)
<project default="hello">
  <target name="hello">
    <echo message="Hello World"/>
  </target>
</project>
eos
      j.add_build_step('Ant').tap do |s|
        s.target = 'hello'
      end
    end

    j.queue_build.should_succeed
  end
end

What do you think about allowing both styles?



[1] http://en.wikipedia.org/wiki/Logo_(programming_language)
[2] https://github.com/jenkinsci/selenium-tests/blob/master/spec/ant_plugin.rb
--
Kohsuke Kawaguchi                          http://kohsuke.org/

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to