Has anyone used Cucumber with Limelight?

2 views
Skip to first unread message

doug livesey

unread,
Nov 9, 2009, 4:52:21 AM11/9/09
to limelig...@googlegroups.com
Hi -- has anyone developed Limelight apps using Cucumber, as well as RSpec?
Are there any code examples if they have?
Cheers,
   Doug.

Micah Martin

unread,
Nov 9, 2009, 8:53:12 AM11/9/09
to limelig...@googlegroups.com
Yes. The plan is to include Cucumber helpers in Limelight but we want
to make sure we're doing it the right way first.

The basic idea is that you can publish productions on DRb and remote
control or test them this way.

Here's a recent example I worked on.

---- sandbox.feature ---

Feature: Sandbox
In order to play with Limelight features
As a user
I want to see the features in action.

Scenario: Sandbox
Given I have the sanbox production opened
When I do nothing
Then The active stage title should be "Limelight Sandbox"

Scenario: Click Me Scene
Given I have the sanbox production opened
And I click on "click_me_link"
When I click on "chromaton"
Then The text of "chromaton" should include "Clicks: 1"
When I click on "chromaton"
Then The text of "chromaton" should include "Clicks: 2"
When I click on "chromaton"
Then The text of "chromaton" should include "Clicks: 3"
When I click on "chromaton"
Then The text of "chromaton" should include "Clicks: 4"
When I click on "chromaton"
Then The text of "chromaton" should include "Clicks: 5"


---- limelight_steps.rb ----

at_exit do
$production.close
end

def scene
return $production.theater.stages[0].current_scene
end

Given /^I have the sanbox production opened$/ do
if $production.nil?
prod_dir = File.expand_path(File.dirname(__FILE__) + "/../../")
@ll_thread = Thread.new { system "jruby -S limelight open --
drb_port=9000 #{prod_dir}" }
require "drb"
DRb.start_service
$production = DRbObject.new(nil, "druby://localhost:9000")
begin
$production.name
rescue Exception => e
sleep(1)
retry
end
end
end

When /^I do nothing$/ do
end

Then /^The active stage title should be "([^\"]*)"$/ do |title|
active_stage = $production.theater.stages[0]
active_stage.title.should == title
end

When /^I click on "([^\"]*)"$/ do |id|
scene.find(id).mouse_clicked(nil)
sleep(0.25)
end

Then /^The text of "([^\"]*)" should include "([^\"]*)"$/ do |id, text|
scene.find(id).text.include?(text).should == true
end

doug livesey

unread,
Nov 9, 2009, 9:09:04 AM11/9/09
to limelig...@googlegroups.com
Oh, I shall have fun with that!
Thankyou!
   Doug.

2009/11/9 Micah Martin <mi...@8thlight.com>
   @ll_thread = Thread.new { system "jruby -S limelight open --drb_port=9000 #{prod_dir}" }

emeyer

unread,
Nov 9, 2009, 5:13:57 PM11/9/09
to limelight
I've also been experimenting with Cucumber in Limelight and actually
have a very simple app up on Github. Here is the link:
http://github.com/ericmeyer/calculator

Eric
Reply all
Reply to author
Forward
0 new messages