13 Dec 2012, 03:28
Bgcover2_pragsmall

Brett Giles (1 post)

Hi all - I had issues with following recipe 22 as laid out for a non-trivial project. Technology was JRuby 1.7 with Monkeybars 1.1.2 and Java 1.6.

I found that using the Before and After hooks failed. The failure was only apparent when running a second scenario - a single scenario would run fine. (I’m not sure of the failure reason - possibly because the fest robot was kept around?). For my app, I had to do an Around hook as follows:

Around do |sc, blk|
 
  runner = GuiActionRunner.execute(AppStarter.new)
  $robot = BasicRobot.robot_with_current_awt_hierarchy
  $qe_frame = FrameFixture.new($robot, "Quantum Emulator")
  blk.call
  
  $robot.clean_up
  $robot = nil

  $qe_frame = nil
  LqplController.instance.close
end

(LqplController is a Monkeybars controller - closing it shuts down the app).

Complete (in-progress) code is at https://bitbucket.org/BrettGilesUofC/lqpl/src under the “feature/TryFlexForSwingTesting” branch.

31 Dec 2012, 19:58
Mr_sketchy_pragsmall

Ian Dees (195 posts)

Hi, Brett.

Thanks for letting us know. I’ve updated the recipe to use a single long-running instance of the PresentationClock app instead of stopping/restarting it.

Thanks also for the link to the LQPL project. What a great polyglot project: back end in Haskell, front end in Java and Ruby, and test scripts in Cucumber!

Wishing you a Happy New Year,

Ian

  You must be logged in to comment