From 304f32e7192650c7ef1b589caf82cfb82e3ca9a9 Mon Sep 17 00:00:00 2001 From: Sylvain Joyeux Date: Wed, 28 Mar 2018 17:27:50 -0300 Subject: [PATCH] features: write a feature for the integration tests page --- .../01 - Syskit Integration.feature | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 features/10 - Testing and Debugging/01 - Syskit Integration.feature diff --git a/features/10 - Testing and Debugging/01 - Syskit Integration.feature b/features/10 - Testing and Debugging/01 - Syskit Integration.feature new file mode 100644 index 0000000..6e7fb1e --- /dev/null +++ b/features/10 - Testing and Debugging/01 - Syskit Integration.feature @@ -0,0 +1,82 @@ +@disable-bundler +@no-clobber +Feature: 14. Integration Tests + Background: + Given I cd to "dev/bundles/syskit_basics" + + Scenario: 01.1 Installing Cucumber support + Given I modify the file "manifest.xml" with: + """ + + + + """ + And within the workspace, I run the following script: + """ + aup --checkout-only + """ + Then within the workspace, I successfully run the following script: + """ + cucumber --init + """ + + Scenario: 01.2 Setting up a Syskit app to use integration tests + Given the file "features/support/env.rb" with: + """ + require 'cucumber/rock_world' + Cucumber::RockWorld.setup + World( + Roby::App::Cucumber::World, + RockGazebo::Syskit::Cucumber::World, + Cucumber::RockWorld) + """ + And within the workspace, I successfully run the following script: + """ + syskit gen action cucumber + """ + And I overwrite the file "models/actions/cucumber.rb" with: + """ + require 'cucumber/models/actions/cucumber' + require 'syskit_basics/models/profiles/gazebo/base' + + module SyskitBasics + module Actions + class Cucumber < Cucumber::Actions::Cucumber + def cucumber_robot_model + # NOTE the device must be the root model, i.e. cannot use ur10_dev + Profiles::Gazebo::Base.ur10_fixed_dev + end + end + end + end + """ + And within the workspace, I successfully run the following script: + """ + syskit gen robot cucumber + """ + And I modify the file "config/robots/cucumber.rb" with: + """ + +require_relative './gazebo' + -Robot.requires do + ... + -end + +Robot.requires do + + require 'syskit_basics/models/actions/cucumber' + +end + -Robot.actions do + ... + -end + +Robot.actions do + + use_library SyskitBasics::Actions::Cucumber + +end + """ + And the file "features/Test Setup.feature" with: + """ + Feature: Checking the Syskit/Cucumber Test Setup + Scenario: Starting a simulation and a Syskit app under Cucumber + Given the cucumber robot starting at origin in the empty world + Then the pose reaches z=0m with a tolerance of 0.1m within 30s + """ + Then within the workspace, I successfully run the following script: + """ + cucumber "features/Test Setup.feature" + """