Skip to content

Instantly share code, notes, and snippets.

@paramadeep
Created February 3, 2015 10:45
Show Gist options
  • Save paramadeep/11c4b8805792b3fc6de4 to your computer and use it in GitHub Desktop.
Save paramadeep/11c4b8805792b3fc6de4 to your computer and use it in GitHub Desktop.
Get the list of scenarios marked as @wip in a cucumber test suite. Includes tags at scenario and feature level.
total_count = 0
Dir['features/**/*.feature'].each do |file|
a= IO.read(file).split("\n").map do |x|
x.rstrip.lstrip
end
a = a.select{|x| x !=nil && x != ""}
printed_file = false
next if a[0].nil?
if a[0].downcase.include? "@wip"
p file.to_s
p " " + a[1]
a.each_with_index do |line,index|
if (line.include? "Scenario: ") && (!line.include? "e2e")
p " " + a[index] +" : " + (index+1).to_s
total_count = total_count + 1
end
end
else
a.each_with_index do |line,index|
if (line.downcase.include? "@wip")
#if (line.downcase.include? "@wip") && (!a[index+1].include? "e2e")
p file.to_s if !printed_file
p " " + a[0] if !printed_file
p " " + a[index+1] +" : " + (index+1).to_s
printed_file = true
total_count = total_count + 1
end
end
end
end
p "Total Count :" + total_count.to_s
@paramadeep
Copy link
Author

Place this file in the root directory of you project and from command prompt run it. (ruby pattiyal.rb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment