Created
February 3, 2015 10:45
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place this file in the root directory of you project and from command prompt run it. (ruby pattiyal.rb)