Skip to content

Commit 519841f

Browse files
committed
Add filtering by tag expression
1 parent ec59b33 commit 519841f

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Usage: assertthat-bdd-features [options]
3838
-p, --projectId PROJECT_ID Jira project id
3939
-o, --outputFolder OUTPUT_FOLDER Featured output folder - default ./features
4040
-m, --mode MODE Mode one of automated,manual,both - deafult automated
41+
-t, --tags <tag-expression> Cucucmber tag expression for scenarios filtering
4142
-j, --jql JQL_FILTER Jql issues filter
4243
-x, --proxy PROXY_URL proxy url to connect to Jira
4344
-h, --help Show help
@@ -85,6 +86,8 @@ task :download_features do
8586
proxy: 'PROXY_URL',
8687
#Optional - default automated (can be one of: manual/automated/both)
8788
mode: 'automated',
89+
#Optional - tag expression filter for scenarios. More on tag expressions https://cucumber.io/docs/cucumber/api/#tag-expressions
90+
tags: '(@smoke or @ui) and (not @slow)',
8891
#Optional - all features downloaded by default - should be a valid JQL
8992
jql: 'project = XX AND key in (\'XXX-1\')'
9093
)

assertthat-bdd.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = %q{assertthat-bdd}
3-
s.version = "1.3.0"
3+
s.version = "1.4.0"
44
s.date = %q{2020-05-08}
55
s.summary = %q{AssertThat bdd integration for Ruby}
66
s.authors = ["Glib Briia"]

bin/assertthat-bdd-features

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ OptionParser.new do |opt|
1212
opt.on('-p','--projectId PROJECT_ID', 'Jira project id') { |o| options[:projectId] = o }
1313
opt.on('-o','--outputFolder OUTPUT_FOLDER', 'Featured output folder - default ./features') { |o| options[:outputFolder] = o }
1414
opt.on('-m','--mode MODE', 'Mode one of automated,manual,both - deafult automated') { |o| options[:mode] = o }
15+
opt.on('-t','--tags <tag-expression>', 'Cucucmber tag expression for scenarios filtering') { |o| options[:tags] = o }
1516
opt.on('-j','--jql JQL_FILTER', 'Jql issues filter') { |o| options[:jql] = o }
1617
opt.on('-x','--proxy PROXY_URL', 'proxy url to connect to Jira') { |o| options[:proxy] = o }
1718
opt.on_tail('-h', '--help', 'Show help') do

lib/assertthat-bdd.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
module AssertThatBDD
77
class Features
8-
def self.download(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, outputFolder: './features/', proxy: nil, mode: 'automated', jql: '', jiraServerUrl: nil)
8+
def self.download(accessKey: ENV['ASSERTTHAT_ACCESS_KEY'], secretKey: ENV['ASSERTTHAT_ACCESS_KEY'], projectId: nil, outputFolder: './features/', proxy: nil, mode: 'automated', jql: '', tags: '', jiraServerUrl: nil)
99
RestClient.proxy = proxy unless proxy.nil?
1010
url = 'https://bdd.assertthat.app/rest/api/1/project/'+ projectId +'/features'
1111
url = jiraServerUrl+"/rest/assertthat/latest/project/"+projectId+"/client/features" unless jiraServerUrl.nil?
1212
resource = RestClient::Resource.new(url, :user => accessKey, :password => secretKey, :content_type => 'application/zip')
1313
begin
14-
contents = resource.get(:accept => 'application/zip', params: {mode: mode, jql: jql})
14+
contents = resource.get(:accept => 'application/zip', params: {mode: mode, jql: jql, tags: tags})
1515
rescue => e
1616

1717
if e.respond_to?('response') then

0 commit comments

Comments
 (0)