File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file.
44
5+ ## Unreleased
6+
7+ - Correctly assign ` testState.pickleStep ` , fixes [ #836 ] ( https://github.com/badeball/cypress-cucumber-preprocessor/issues/836 ) .
8+
59## v13.0.1
610
711- Support absolute paths in ` stepDefinitions ` , fixes [ #832 ] ( https://github.com/badeball/cypress-cucumber-preprocessor/issues/832 ) .
Original file line number Diff line number Diff line change @@ -56,13 +56,17 @@ Feature: window.testState
5656 Feature: a feature name
5757 Scenario: a scenario name
5858 Given a step
59+ And another step
5960 """
6061 And a file named "cypress/e2e/a.js" with:
6162 """
6263 const { Given } = require("@badeball/cypress-cucumber-preprocessor");
6364 Given("a step", function() {
6465 expect(testState.pickleStep.text).to.equal("a step");
6566 });
67+ Given("another step", function() {
68+ expect(testState.pickleStep.text).to.equal("another step");
69+ });
6670 """
6771 When I run cypress
6872 Then it passes
Original file line number Diff line number Diff line change @@ -352,11 +352,11 @@ function createPickle(
352352
353353 for ( const step of steps ) {
354354 if ( step . hook ) {
355- delete window . testState . pickleStep ;
356-
357355 const hook = step . hook ;
358356
359357 cy . then ( ( ) => {
358+ delete window . testState . pickleStep ;
359+
360360 Cypress . log ( {
361361 name : "step" ,
362362 displayName : hook . keyword ,
@@ -402,8 +402,6 @@ function createPickle(
402402 remainingSteps . shift ( ) ;
403403 } ) ;
404404 } else if ( step . pickleStep ) {
405- window . testState . pickleStep = step . pickleStep ;
406-
407405 const pickleStep = step . pickleStep ;
408406
409407 const text = assertAndReturn (
@@ -422,6 +420,8 @@ function createPickle(
422420 ) ;
423421
424422 cy . then ( ( ) => {
423+ window . testState . pickleStep = step . pickleStep ;
424+
425425 Cypress . log ( {
426426 name : "step" ,
427427 displayName : assertAndReturn (
You can’t perform that action at this time.
0 commit comments