You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation, multiple after hooks are executed in the reverse order that they were defined.
After upgrading to cucumber version 2.0.0x, the after hooks are executed in the correct order on the 1st scenario and on the second scenario the after hooks are executed from top to bottom as they are defined.
Here are the sample files to reproduce the issue:
hooks.js
'use strict';var{defineSupportCode}=require('cucumber');defineSupportCode(function({After,Before}){After({tags: '@test'},function(scenario){console.log('First After Hook');});After(function(scenario){console.log('Second After Hook');});Before({tags: '@test'},function(scenario){console.log('First Before Hook');});Before(function(scenario){console.log('Second Before Hook');});});
TestHooks.feature
@test
Feature: Sample test
Scenario: Scenario 1
Given I navigate to the a test site
When I do something
Then something happens
Scenario: Scenario 2
Given I navigate to the a test site
When I do something
Then something happens
Scenario: Scenario 3
Given I navigate to the a test site
When I do something
Then something happens
node_modules\.bin\cucumber-js.cmd --require features --format pretty -t @test
Result:
Prints the console message in the correct order from Before Hooks for all scenarios.
But the after hooks prints the console messages in different order between scenarios.
The text was updated successfully, but these errors were encountered:
Thanks for the report! Very sorry about that. Appears the bug is related to reverse(). I had thought it returned a new array but it morphs the original. Should have a fix for this soon
Node version: v6.9.4
Cucumberjs: 2.0.0-rc.6
According to the documentation, multiple after hooks are executed in the reverse order that they were defined.
After upgrading to cucumber version 2.0.0x, the after hooks are executed in the correct order on the 1st scenario and on the second scenario the after hooks are executed from top to bottom as they are defined.
Here are the sample files to reproduce the issue:
hooks.js
TestHooks.feature
node_modules\.bin\cucumber-js.cmd --require features --format pretty -t @test
Result:
Prints the console message in the correct order from Before Hooks for all scenarios.
But the after hooks prints the console messages in different order between scenarios.
The text was updated successfully, but these errors were encountered: