<% base_requires = '-r features/support -r features/step_definitions' %> <% default_options = "--format progress --strict --tags ~@selenium --tags ~@selenium-fixme --tags ~@fixme --exclude features/support/selenium.rb #{base_requires}" %> <% default_options += ' --color' if $stdout.isatty %> <% selenium_options = "--strict --tags @selenium #{base_requires}" %> default: <%= default_options %> selenium: <%= selenium_options %> <% enabled_plugins = Dir.glob(File.join('config', 'plugins', '*')).map{|path| plugin = File.basename(path); plugin if File.exist?(File.join('features', 'plugins', plugin)) }.compact %> <% enabled_plugins.each do |plugin| %> <% plugin_features_path = File.join('features', 'plugins', plugin) %> <% plugin_base_requires = '' %> <% plugin_base_requires += " -r features/plugins/#{plugin}/support" if File.exist?(File.join(plugin_features_path, 'support')) %> <% plugin_base_requires += " -r features/plugins/#{plugin}/step_definitions" if File.exist?(File.join(plugin_features_path, 'step_definitions')) %> <%= "#{plugin}: #{default_options} #{plugin_base_requires}" %> <%= "#{plugin}_selenium: #{selenium_options} #{plugin_base_requires}" %> <% end %>