air_test 0.1.5.2 → 0.1.5.4
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/lib/air_test/notion_parser.rb +8 -6
- data/lib/air_test/runner.rb +2 -2
- data/lib/air_test/spec_generator.rb +1 -0
- data/lib/air_test/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec50dc985e53dbbb63a785aee66594b94387384039f7db14677004ee2fce3178
|
4
|
+
data.tar.gz: bf0a4675e548c04c695059e949674c9b6ca2d67ce1135471a56ff09072fe1aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9321031cb35c3c6bac0f6400edb9efb8f8305247c64a9a6cf3136931dcbcd908ccf3b80feca89bb550744359f679addd6b0f84c2fd03794f3dba7dc78544bc4
|
7
|
+
data.tar.gz: 2521991e2cbe8dd447a4192436c1b2123d2e5313fbf04ce7a81f27a81a12e26f719f3ce8dfb880a39334d658cd105cfe73d0f91c74f6cf2a71ce285ae6b55f25
|
@@ -84,11 +84,10 @@ module AirTest
|
|
84
84
|
in_background_block = false
|
85
85
|
background_steps = []
|
86
86
|
|
87
|
-
blocks.
|
87
|
+
blocks.each do |block|
|
88
88
|
block_type = block["type"]
|
89
89
|
text = extract_text(block[block_type]["rich_text"]) rescue ""
|
90
90
|
|
91
|
-
# Detect headings for feature, background, and scenario
|
92
91
|
if %w[heading_1 heading_2 heading_3].include?(block_type)
|
93
92
|
heading_text = text.strip
|
94
93
|
if heading_text.downcase.include?("feature")
|
@@ -101,6 +100,7 @@ module AirTest
|
|
101
100
|
in_feature_block = false
|
102
101
|
in_scenario_block = false
|
103
102
|
elsif heading_text.downcase.include?("scenario")
|
103
|
+
# Start a new scenario
|
104
104
|
in_scenario_block = true
|
105
105
|
in_feature_block = false
|
106
106
|
in_background_block = false
|
@@ -112,7 +112,7 @@ module AirTest
|
|
112
112
|
in_background_block = false
|
113
113
|
end
|
114
114
|
elsif block_type == "paragraph" && text.strip.downcase.start_with?("scenario:")
|
115
|
-
#
|
115
|
+
# Start a new scenario from a paragraph
|
116
116
|
in_scenario_block = true
|
117
117
|
in_feature_block = false
|
118
118
|
in_background_block = false
|
@@ -125,12 +125,14 @@ module AirTest
|
|
125
125
|
elsif in_background_block
|
126
126
|
background_steps << text
|
127
127
|
elsif in_scenario_block && current_scenario
|
128
|
-
|
128
|
+
# Only add as step if not a scenario heading
|
129
|
+
unless text.strip.downcase.start_with?("scenario:")
|
130
|
+
current_scenario[:steps] << text
|
131
|
+
end
|
129
132
|
end
|
130
133
|
elsif block_type == "callout"
|
131
134
|
text = extract_text(block["callout"]["rich_text"])
|
132
135
|
next if text.empty?
|
133
|
-
|
134
136
|
if text.downcase.include?("tag")
|
135
137
|
tags = extract_tags(text)
|
136
138
|
parsed_data[:meta][:tags].concat(tags)
|
@@ -168,7 +170,7 @@ module AirTest
|
|
168
170
|
in_steps = false
|
169
171
|
end
|
170
172
|
elsif %w[paragraph bulleted_list_item numbered_list_item].include?(block_type)
|
171
|
-
steps << text if in_steps && !text.empty?
|
173
|
+
steps << text if in_steps && !text.empty? && !text.strip.downcase.start_with?("scenario:")
|
172
174
|
end
|
173
175
|
end
|
174
176
|
if steps.any?
|
data/lib/air_test/runner.rb
CHANGED
@@ -35,8 +35,8 @@ module AirTest
|
|
35
35
|
if has_changes
|
36
36
|
pr_title = title
|
37
37
|
scenarios_md = parsed_data[:scenarios].map.with_index(1) do |sc, _i|
|
38
|
-
steps = sc[:steps]&.join("
|
39
|
-
" - [ ] #{sc[:title]}
|
38
|
+
steps = sc[:steps]&.map { |step| " - #{step}" }&.join("\n")
|
39
|
+
" - [ ] #{sc[:title]}\n#{steps}"
|
40
40
|
end.join("\n")
|
41
41
|
pr_body = <<~MD
|
42
42
|
- **Story Notion :** #{url}
|
data/lib/air_test/version.rb
CHANGED