@@ -77,13 +77,13 @@ limitations under the License.
7777 Sections
7878 </button>
7979 {% endif %}
80- {% if element.hasHooks() and element.hasHooksWithContent() %}
80+ {% if element.hasHooks() %}
8181 <button class="secondary outline" type="button" id="before-after-hooks-button"
8282 data-cluecumber-item="before-after-hooks-button">{{ expandBeforeAfterHooks ? 'Hide' : 'Show' }}
8383 Hooks
8484 </button>
8585 {% endif %}
86- {% if element.hasStepHooks() and element.hasStepHooksWithContent() %}
86+ {% if element.hasStepHooks() %}
8787 <button class="secondary outline" type="button" id="step-hooks-button"
8888 data-cluecumber-item="step-hooks-button">{{ expandStepHooks ? 'Hide' : 'Show' }} Step Hooks
8989 </button>
@@ -108,12 +108,11 @@ limitations under the License.
108108 {% endif %}
109109 {{ page.cardEnd() }}
110110
111- {% if element.before is not empty and element.anyBeforeHookHasContent() %}
111+ {% if element.before is not empty %}
112112 <div class="scenarioHook collapse {{ expandBeforeAfterHooks ? 'show' : '' }}">
113113 {{ page.cardStart("12", "Before Hooks", "", "") }}
114114 <li class="cluecumber-list-item">
115115 {% for before in element.before %}
116- {% if before.hasContent() or before.isFailed() %}
117116 <div class="row row_{{ before.consolidatedStatusString }} table-row-{{ before.consolidatedStatusString }}">
118117 <div class="cluecumber-step-name">
119118 <span>{{ loop.index + 1 }}.</span>
@@ -125,11 +124,11 @@ limitations under the License.
125124 <div class="cluecumber-step-status cluecumber-align-right">
126125 {{ common.status(before.consolidatedStatusString) }}
127126 </div>
128- {% set step = before %}{% include "macros/scenario-error-message" %}
127+ {% set hookExceptionId = "before_" ~ loop.index %}
128+ {% include "macros/scenario-hook-error-message" with {"hook": before, "exceptionId": hookExceptionId} %}
129129 {% set step = before %}{% set sectionId = "before" %}{% include "macros/scenario-output" %}
130130 {% set step = before %}{% include "macros/scenario-attachments" %}
131131 </div>
132- {% endif %}
133132 {% endfor %}
134133 </li>
135134 {{ page.cardEnd() }}
@@ -174,7 +173,7 @@ limitations under the License.
174173 class="keyword">{{ step.keyword }}</span> {{ stepName|raw }}</a>
175174 </span>
176175 </span>
177- {% if step.hasSubSections() or (step.docString is not null and step.docString.value is not null) or step.hasHooksWithContent () %}
176+ {% if step.hasSubSections() or (step.docString is not null and step.docString.value is not null) or step.hasHooks () %}
178177 <div class="exception-links-top">
179178 {% if step.hasSubSections() %}
180179 <button type="button" class="cluecumber-exception-action secondary outline sectionExpansionButton"
@@ -188,7 +187,7 @@ limitations under the License.
188187 aria-expanded="false"
189188 data-target="#step_{{ step.index }}_docstring">DocString</button>
190189 {% endif %}
191- {% if step.hasHooksWithContent () %}
190+ {% if step.hasHooks () %}
192191 <button type="button" class="cluecumber-exception-action secondary outline stepHooksExpansionButton"
193192 data-toggle="collapse"
194193 aria-expanded="false"
@@ -280,7 +279,7 @@ limitations under the License.
280279 class="keyword">{{ step.keyword }}</span> {{ stepName|raw }}</a>
281280 </span>
282281 </span>
283- {% if step.hasSubSections() or (step.docString is not null and step.docString.value is not null) or step.hasHooksWithContent () %}
282+ {% if step.hasSubSections() or (step.docString is not null and step.docString.value is not null) or step.hasHooks () %}
284283 <div class="exception-links-top">
285284 {% if step.hasSubSections() %}
286285 <button type="button" class="cluecumber-exception-action secondary outline sectionExpansionButton"
@@ -294,7 +293,7 @@ limitations under the License.
294293 aria-expanded="false"
295294 data-target="#step_{{ step.index }}_docstring">DocString</button>
296295 {% endif %}
297- {% if step.hasHooksWithContent () %}
296+ {% if step.hasHooks () %}
298297 <button type="button" class="cluecumber-exception-action secondary outline stepHooksExpansionButton"
299298 data-toggle="collapse"
300299 aria-expanded="false"
@@ -348,12 +347,11 @@ limitations under the License.
348347 {{ page.cardEnd() }}
349348 {% endif %}
350349
351- {% if element.after is not empty and element.anyAfterHookHasContent() %}
350+ {% if element.after is not empty %}
352351 <div class="scenarioHook collapse {{ expandBeforeAfterHooks ? 'show' : '' }}">
353352 {{ page.cardStart("12", "After Hooks", "", "") }}
354353 <li class="cluecumber-list-item">
355354 {% for after in element.after %}
356- {% if after.hasContent() or after.isFailed() %}
357355 <div class="row row_{{ after.consolidatedStatusString }} table-row-{{ after.consolidatedStatusString }}">
358356 <div class="cluecumber-step-name">
359357 <span>{{ loop.index + 1 }}.</span>
@@ -365,11 +363,11 @@ limitations under the License.
365363 <div class="cluecumber-step-status cluecumber-align-right">
366364 {{ common.status(after.consolidatedStatusString) }}
367365 </div>
368- {% set step = after %}{% include "macros/scenario-error-message" %}
366+ {% set hookExceptionId = "after_" ~ loop.index %}
367+ {% include "macros/scenario-hook-error-message" with {"hook": after, "exceptionId": hookExceptionId} %}
369368 {% set step = after %}{% set sectionId = "after" %}{% include "macros/scenario-output" %}
370369 {% set step = after %}{% include "macros/scenario-attachments" %}
371370 </div>
372- {% endif %}
373371 {% endfor %}
374372 </li>
375373 {{ page.cardEnd() }}
@@ -380,10 +378,10 @@ limitations under the License.
380378 <script>
381379 let classState = {};
382380
383- {% if element.hasHooks() and element.hasHooksWithContent() %}
381+ {% if element.hasHooks() %}
384382 classState['scenarioHook'] = {{ expandBeforeAfterHooks ? "true" : "false" }};
385383 {% endif %}
386- {% if element.hasStepHooks() and element.hasStepHooksWithContent() %}
384+ {% if element.hasStepHooks() %}
387385 classState['.stepHook'] = {{ expandStepHooks ? "true" : "false" }};
388386 {% endif %}
389387 {% if element.hasSubSections() %}
@@ -449,7 +447,7 @@ limitations under the License.
449447 });
450448 {% endif %}
451449
452- {% if element.hasHooks() and element.hasHooksWithContent() %}
450+ {% if element.hasHooks() %}
453451 document.getElementById('before-after-hooks-button').addEventListener('click', function (event) {
454452 toggleHooks('scenarioHook', {{ expandBeforeAfterHooks ? "true" : "false" }});
455453 event.target.textContent = classState['scenarioHook'] ? 'Hide Hooks' : 'Show Hooks';
@@ -475,7 +473,7 @@ limitations under the License.
475473 });
476474 {% endif %}
477475
478- {% if element.hasStepHooks() and element.hasStepHooksWithContent() %}
476+ {% if element.hasStepHooks() %}
479477 document.getElementById('step-hooks-button').addEventListener('click', function (event) {
480478 toggleCollapsableSection('.stepHook', {{ expandStepHooks ? "true" : "false" }});
481479 event.target.textContent = classState['.stepHook'] ? 'Hide Step Hooks' : 'Show Step Hooks';
0 commit comments