zephyr_cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +9 -0
- data/Gemfile +5 -5
- data/README.md +3 -5
- data/lib/zephyr_cli/helpers/cli_helpers.rb +29 -0
- data/lib/zephyr_cli/test_cycles.rb +46 -3
- data/lib/zephyr_cli/test_plans.rb +20 -3
- data/lib/zephyr_cli/version.rb +2 -2
- data/lib/zephyr_cli.rb +16 -8
- data/zephyr_cli-0.1.0.gem +0 -0
- data/zephyr_cli.gemspec +1 -1
- metadata +4 -4
- data/lib/zephyr_cli/helpers/zephyr_client.rb +0 -7
- data/lib/zephyr_cli/test_cases.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3c4194d263d8837a099c4307fd535c20b2423d1f170540e9bef95de9eef911f
|
4
|
+
data.tar.gz: 611479b3ca37be02b25e2438e7b5a5ba3562ed6ca5bc99f6a3d6edddeb3c2a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 129e0a9dcd71d6fd5f5122604ec210386780e5128c01d5542c8c85c9a1bd1962b9bbf8dc82a7d3f2742e32349baa840856dc4194dbc0d54d24e7404451c7aff4
|
7
|
+
data.tar.gz: dd675f021111e9c1f1caa32086dc978160a9b5c0f8ff2794811343c9a813bb09f264c36d44c2a9f5093e1df516c751e660a6e35bf5d1822c681a2c9ba7d95f64
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem
|
6
|
-
gem
|
7
|
-
gem
|
8
|
-
gem
|
5
|
+
gem "rake", "~> 13.0"
|
6
|
+
gem "rubocop", "~> 0.80"
|
7
|
+
gem "thor"
|
8
|
+
gem "zephyr_ruby"
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# ZephyrCLI
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
The handy CLI for managing all your zephyr related testing resources.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,7 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
🚧 In progress.
|
26
24
|
|
27
25
|
## Development
|
28
26
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# CLIHelpers module to share common methods among the CLI classes
|
4
|
+
module CLIHelpers
|
5
|
+
def generate_automations_payload(project_id, file, _auto_close_cycle, name, description,
|
6
|
+
auto_create_test_cases: false)
|
7
|
+
auto_create_test_cases = true if auto_create_test_cases
|
8
|
+
|
9
|
+
{
|
10
|
+
projectKey: project_id,
|
11
|
+
autoCreateTestCases: auto_create_test_cases,
|
12
|
+
file: file,
|
13
|
+
testCycle: {
|
14
|
+
name: name,
|
15
|
+
description: description
|
16
|
+
}
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def generate_test_cycle_payload(name, description, start_date, end_date, project_id)
|
21
|
+
{
|
22
|
+
name: name,
|
23
|
+
description: description,
|
24
|
+
plannedStartDate: start_date,
|
25
|
+
plannedEndDate: end_date,
|
26
|
+
projectId: project_id
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
@@ -1,8 +1,51 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Subcommand for creating and updating test cycles as well as uploading results in junit and cucumber format
|
3
4
|
class TestCycles < Thor
|
4
|
-
desc "
|
5
|
-
|
6
|
-
|
5
|
+
desc "upload_junit_results", "Upload test results in junit format"
|
6
|
+
method_option :project_id, type: :numeric, required: true
|
7
|
+
method_option :file, type: :string, required: true
|
8
|
+
method_option :name, type: :string, required: true
|
9
|
+
method_option :description, type: :string, required: false
|
10
|
+
method_option :auto_create_test_cases, type: :boolean, required: false
|
11
|
+
def upload_junit_results(project_id, file, auto_close_cycle, name, description, auto_create_test_cases)
|
12
|
+
payload = generate_automations_payload(project_id, file, auto_close_cycle, name, description,
|
13
|
+
auto_create_test_cases)
|
14
|
+
@zephyr_client.create_automation_junit(payload)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "upload_cucumber_results", "Upload test results in cucumber format"
|
18
|
+
method_option :project_id, type: :numeric, required: true
|
19
|
+
method_option :file, type: :string, required: true
|
20
|
+
method_option :name, type: :string, required: true
|
21
|
+
method_option :description, type: :string, required: false
|
22
|
+
method_option :auto_create_test_cases, type: :boolean, required: false
|
23
|
+
def upload_cucumber_results(_test_cycle_id, _cucumber_format)
|
24
|
+
payload = generate_automations_payload(project_id, file, auto_close_cycle, name, description,
|
25
|
+
auto_create_test_cases)
|
26
|
+
@zephyr_client.create_automation_cucumber(payload)
|
27
|
+
end
|
28
|
+
|
29
|
+
desc "create", "Create test cycle"
|
30
|
+
method_option :project_id, type: :numeric, required: true
|
31
|
+
method_option :name, type: :string, required: true
|
32
|
+
method_option :description, type: :string, required: true
|
33
|
+
method_option :start_date, type: :string, required: true
|
34
|
+
method_option :end_date, type: :string, required: true
|
35
|
+
def create(name, description, start_date, end_date, project_id)
|
36
|
+
payload = generate_test_cycle_payload(name, description, start_date, end_date, project_id)
|
37
|
+
@zephyr_client.create_test_cycle(payload)
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "update", "Update test cycle"
|
41
|
+
method_option :project_id, type: :numeric, required: true
|
42
|
+
method_option :test_cycle_id, type: :numeric, required: true
|
43
|
+
method_option :name, type: :string, required: true
|
44
|
+
method_option :description, type: :string, required: true
|
45
|
+
method_option :start_date, type: :string, required: true
|
46
|
+
method_option :end_date, type: :string, required: true
|
47
|
+
def update(_test_cycle_id, name, description, start_date, end_date, project_id)
|
48
|
+
payload = generate_test_cycle_payload(name, description, start_date, end_date, project_id)
|
49
|
+
@zephyr_client.update_test_cycle(payload)
|
7
50
|
end
|
8
51
|
end
|
@@ -1,8 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Subcommand for creating and updating test plans
|
3
4
|
class TestPlans < Thor
|
4
|
-
desc "
|
5
|
-
|
6
|
-
|
5
|
+
desc "create", "Create test plan"
|
6
|
+
method_option :name, type: :string, required: true
|
7
|
+
method_option :description, type: :string, required: true
|
8
|
+
method_option :start_date, type: :string, required: true
|
9
|
+
method_option :end_date, type: :string, required: true
|
10
|
+
method_option :project_id, type: :numeric, required: true
|
11
|
+
def create_test_plan(name, description, start_date, end_date, project_id)
|
12
|
+
# TODO: Implement logic for creating test plan
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "update", "Update test plan"
|
16
|
+
method_option :test_plan_id, type: :numeric, required: true
|
17
|
+
method_option :name, type: :string, required: true
|
18
|
+
method_option :description, type: :string, required: true
|
19
|
+
method_option :start_date, type: :string, required: true
|
20
|
+
method_option :end_date, type: :string, required: true
|
21
|
+
method_option :project_id, type: :numeric, required: true
|
22
|
+
def update_test_plan(test_plan_id, name, description, start_date, end_date, project_id)
|
23
|
+
# TODO: Implement logic for updating test plan
|
7
24
|
end
|
8
25
|
end
|
data/lib/zephyr_cli/version.rb
CHANGED
data/lib/zephyr_cli.rb
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "zephyr_ruby"
|
4
|
+
require "thor"
|
5
|
+
require "nokogiri"
|
3
6
|
require_relative "zephyr_cli/version"
|
7
|
+
require_relative "zephyr_cli/test_cycles"
|
8
|
+
require_relative "zephyr_cli/test_plans"
|
9
|
+
require_relative "zephyr_cli/helpers/cli_helpers"
|
4
10
|
|
5
|
-
|
6
|
-
class Error < StandardError; end
|
11
|
+
@zephyr_client = ZephyrRuby::Client.new(ENV["ZEPHYR_API_KEY"])
|
7
12
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
# CLI for creating test cycles and test plans in zephyr
|
14
|
+
class CLI < Thor
|
15
|
+
desc "test_cycles", "Test cycles commands"
|
16
|
+
subcommand "test_cycles", TestCycles
|
17
|
+
|
18
|
+
desc "test_plans", "Test plans commands"
|
19
|
+
subcommand "test_plans", TestPlans
|
14
20
|
end
|
21
|
+
|
22
|
+
CLI.start(ARGV)
|
Binary file
|
data/zephyr_cli.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zephyr_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Zephyr CLI
|
14
14
|
email:
|
@@ -26,11 +26,11 @@ files:
|
|
26
26
|
- bin/console
|
27
27
|
- bin/setup
|
28
28
|
- lib/zephyr_cli.rb
|
29
|
-
- lib/zephyr_cli/helpers/
|
30
|
-
- lib/zephyr_cli/test_cases.rb
|
29
|
+
- lib/zephyr_cli/helpers/cli_helpers.rb
|
31
30
|
- lib/zephyr_cli/test_cycles.rb
|
32
31
|
- lib/zephyr_cli/test_plans.rb
|
33
32
|
- lib/zephyr_cli/version.rb
|
33
|
+
- zephyr_cli-0.1.0.gem
|
34
34
|
- zephyr_cli.gemspec
|
35
35
|
homepage: https://github.com/cdavis-personal/zephyr_cli
|
36
36
|
licenses: []
|