air_test 0.1.5.0 → 0.1.5.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/lib/air_test/notion_parser.rb +19 -2
- 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: f817f7224c6f3bc2bc49607ce00e9e069701e85c2bfeab3015aff5795ce0767b
|
4
|
+
data.tar.gz: a79251b05748bdf35a4b9befaea87bdb9bf3271d4eafaded2e14403911dd3a0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1befd0f3de325c240a0299a99ffb1e359282d57e36c1f713a2bef8d7fe1ff2ac927deb183e3dcfb23aab362a63eddb3b5eaa1207c8b7bbe6ec796e043c3e3875
|
7
|
+
data.tar.gz: 0246d8260912850bec3d9ca8391a1441bf964a92ff343b4fc5d12224f3923c883ac07bd1bcb97edbf3ae8e3d372bc508b266c19072361a38f0420ad5b0ee5901
|
@@ -81,7 +81,8 @@ module AirTest
|
|
81
81
|
current_scenario = nil
|
82
82
|
in_feature_block = false
|
83
83
|
in_scenario_block = false
|
84
|
-
|
84
|
+
in_background_block = false
|
85
|
+
background_steps = []
|
85
86
|
blocks.each_with_index do |block, idx|
|
86
87
|
case block["type"]
|
87
88
|
when "heading_1", "heading_2", "heading_3"
|
@@ -89,15 +90,22 @@ module AirTest
|
|
89
90
|
if heading_text.downcase.include?("feature")
|
90
91
|
in_feature_block = true
|
91
92
|
in_scenario_block = false
|
93
|
+
in_background_block = false
|
92
94
|
parsed_data[:feature] = heading_text
|
95
|
+
elsif heading_text.strip.downcase == "background:"
|
96
|
+
in_background_block = true
|
97
|
+
in_feature_block = false
|
98
|
+
in_scenario_block = false
|
93
99
|
elsif heading_text.downcase.include?("scenario")
|
94
100
|
in_scenario_block = true
|
95
101
|
in_feature_block = false
|
102
|
+
in_background_block = false
|
96
103
|
current_scenario = { title: heading_text, steps: [] }
|
97
104
|
parsed_data[:scenarios] << current_scenario
|
98
105
|
else
|
99
106
|
in_feature_block = false
|
100
107
|
in_scenario_block = false
|
108
|
+
in_background_block = false
|
101
109
|
end
|
102
110
|
when "paragraph"
|
103
111
|
text = extract_text(block["paragraph"]["rich_text"])
|
@@ -105,6 +113,8 @@ module AirTest
|
|
105
113
|
|
106
114
|
if in_feature_block
|
107
115
|
parsed_data[:feature] += "\n#{text}"
|
116
|
+
elsif in_background_block
|
117
|
+
background_steps << text
|
108
118
|
elsif in_scenario_block && current_scenario
|
109
119
|
current_scenario[:steps] << text
|
110
120
|
end
|
@@ -114,6 +124,8 @@ module AirTest
|
|
114
124
|
|
115
125
|
if in_feature_block
|
116
126
|
parsed_data[:feature] += "\n• #{text}"
|
127
|
+
elsif in_background_block
|
128
|
+
background_steps << text
|
117
129
|
elsif in_scenario_block && current_scenario
|
118
130
|
current_scenario[:steps] << text
|
119
131
|
end
|
@@ -132,7 +144,12 @@ module AirTest
|
|
132
144
|
parsed_data[:meta][:assignee] = extract_assignee(text)
|
133
145
|
end
|
134
146
|
end
|
135
|
-
|
147
|
+
end
|
148
|
+
# Prepend background steps to each scenario
|
149
|
+
if background_steps.any?
|
150
|
+
parsed_data[:scenarios].each do |scenario|
|
151
|
+
scenario[:steps] = background_steps + scenario[:steps]
|
152
|
+
end
|
136
153
|
end
|
137
154
|
# Handle case where there is only one scenario and no explicit scenario heading
|
138
155
|
if parsed_data[:scenarios].empty?
|
data/lib/air_test/version.rb
CHANGED