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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2e98274b6a895b0b6c0e39108f32114b56456f4ed10e9f8dddc82a5e0ea1dfe
4
- data.tar.gz: 9d839e439c871bb5a1e88b89420da3e28ca1baec3f8771c682aab7a8b703e2eb
3
+ metadata.gz: ec50dc985e53dbbb63a785aee66594b94387384039f7db14677004ee2fce3178
4
+ data.tar.gz: bf0a4675e548c04c695059e949674c9b6ca2d67ce1135471a56ff09072fe1aa5
5
5
  SHA512:
6
- metadata.gz: 8aea7c921c0941b905f6e25613b1c32b7105543337ff185020c2cd55609be468daaf190a41fdc2580c0e5d00388e54edf5eeb43be214f10df7fa1fc41aea05e2
7
- data.tar.gz: 919f4c97ed47103ba86ce3d7bacc63feb473e8f7ceb1667e60daa59e171780f3a7a807b8e0ba10484791445689302cc36792fe690581cc15a520407762241094
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.each_with_index do |block, idx|
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
- # Also detect scenario in paragraphs (for robustness)
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
- current_scenario[:steps] << text
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?
@@ -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]}#{steps}"
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}
@@ -22,6 +22,7 @@ module AirTest
22
22
  f.puts " pending '#{step}'"
23
23
  end
24
24
  f.puts " end"
25
+ f.puts ""
25
26
  end
26
27
  f.puts "end"
27
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AirTest
4
- VERSION = "0.1.5.2"
4
+ VERSION = "0.1.5.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5.2
4
+ version: 0.1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - julien bouland