lib/capistrano/ghostinspector.rb in capistrano-ghostinspector-0.3.0 vs lib/capistrano/ghostinspector.rb in capistrano-ghostinspector-0.4.0

- old
+ new

@@ -43,10 +43,14 @@ # Get tests and suites from command line set :gitest, fetch(:gitest, nil) set :gisuite, fetch(:gisuite, nil) + # Get any default tests that have been set on the stage + set :gi_default_test, fetch(:gi_default_test, nil) + set :gi_default_suite, fetch(:gi_default_suite, nil) + # Check if GI is enabled for this deployment (Default: true) set :gi_enabled, fetch(:gi_enabled, gi_config['gi_enabled']) # Should we rollback on failed GI tests (Default: true) set :rollback, fetch(:rollback, gi_config['rollback']) @@ -59,19 +63,19 @@ giApi = Api.new(fetch(:gi_api_key), fetch(:domain), fetch(:rollback), fetch(:ga_property)) @collection = Array.new # run each test - Capistrano::Ghostinspector.getTests(fetch(:gitest), gi_config["tests"]).each do |test| + Capistrano::Ghostinspector.getTests(fetch(:gitest), gi_config["tests"], fetch(:gi_default_test)).each do |test| puts "* * * Running Ghost Inspector Test * * *" set :data, giApi.executeApi("tests", test) items = { :passing => data[0], :results => data[1], :type => "tests"} @collection << items end # run each suite - Capistrano::Ghostinspector.getTests(fetch(:gisuite), gi_config["suites"]).each do |suite| + Capistrano::Ghostinspector.getTests(fetch(:gisuite), gi_config["suites"], fetch(:gi_default_suite)).each do |suite| puts "* * * Running Ghost Inspector Suite * * *" set :data, giApi.executeApi("suites", suite) data[1]["data"].each do |test| items = { :passing => test["passing"], :results => test, :type => "suites"} \ No newline at end of file