Add support to fit, fdescribe, fscenario,fwhen, fgiven, fstory, ffeature, fthen
Description
Gliffy Diagrams
Activity
Show:
Luis MajanoSeptember 27, 2019 at 8:50 PM
@David Moreno Fernández Can you create a new ticket for this please, it reads amazing!
David Moreno FernándezSeptember 27, 2019 at 7:39 PMEdited
A crazy idea: define feature to receive variable arguments to avoid so many levels of nesting. The code looks more like Gherkin, reusable steps could easily be defined https://cucumber.io/docs/cucumber/step-definitions/
// steps may be defined in other file. dimensionsSteps.cfc?
stepGiven("/^(I have )?a width of ([0-9]+)$/", function( ignore_param, value ){
width = value;
} );
stepGiven("/^(I have )?a height of ([0-9]+)$/", function( ignore_param, value ){
height = value;
} );
stepGiven("/^(I have )?a depth of ([0-9]+)$/", function( ignore_param, value ){
depth = value;
} );
stepThen( "/^the result should be ([0-9]+)$/", function( result_expected ){
expect( myObject.myFunction( width, height, depth ) ).toBe( result_expected );
} )
feature( "As a distribution manager, I want to know the volume of the box I need",
Given( "I have a width of 20" ),
And( "a height of 30" ),
And( "a depth of 40" ),
When( "I run the calculation" ),
Then( "the result should be 24000" )
});
feature( "As a distribution manager, the volumen of the box should has a minimum (1)",
Given( "I have a width of 2" ),
And( "a height of 3" ),
And( "a depth of 4" ),
When( "I run the calculation" ),
Then( "the result should be 24" )
});
feature( "As a distribution manager, the volumen of the box should has a minimum (10)",
Given( "I have a width of 2" ),
And( "a height of 1" ),
And( "a depth of 1" ),
When( "I run the calculation" ),
Then( "the result should be 10" )
});
Brad WoodJuly 22, 2019 at 4:49 PM
@Luis Majano This came up in my training. When will it be implemented?
Brad WoodSeptember 8, 2017 at 7:06 PM
@Eric Peterson I think they should be. In fact, someone asked me the other day why the "x" convention didn't apply.
Eric PetersonSeptember 8, 2017 at 6:26 PM
Can these be added to all the suite methods? (feature
, story
, scenario
, given
, when
, and then
)
Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Luis MajanoLuis MajanoReporter
David Moreno FernándezDavid Moreno FernándezLabels
Components
Fix versions
Priority
Minor
Details
Details
Assignee
Luis Majano
Luis MajanoReporter
David Moreno Fernández
David Moreno FernándezLabels
Components
Fix versions
Priority
Sentry
Linked Issues
Sentry
Linked Issues
Sentry
Linked Issues
Created September 6, 2017 at 9:19 PM
Updated September 27, 2019 at 8:50 PM
Resolved September 27, 2019 at 4:59 PM
Add support to use fit and fdescribe methods to force test-cases (and exclude the other test-cases).
Examples with Jasmine:
Simply using fit() instead of it() we could exclude a specific test. The f means focused.
If you want to run a specific test, use fit() instead of it(). The f stands for focused.
describe("description", function() { fit("test 1", function() { }); it("test 2", function() { }); });
Use fdescribe() instead of describe() if you want to only run a specific describe() block.
fdescribe("description", function() { it("test 1", function() { }); it("test 2", function() { }); it("test 3", function() { }); });