Parameterized steps
See original GitHub issueSometimes you have steps which repeat themselves but have constant arguments that can be determined during story definition.
For example a step which uploads a file to an S3 bucket can be parameterized by the S3 bucket it should be uploading to. The alternative would be to create a step which simply sets the context to a constant before the execution of the upload step. This is verbose and frankly unnecessary.
Suggested syntax:
class Foo:
@story
@arguments("file")
def do(I):
I.upload_to_s3.partial(bucket_name='special_files')
def upload_to_s3(self, ctx, bucket_name='default'):
pass
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
JUnit Parameterized Test with Example using @Parameters
Steps to create a Parameterized JUnit test. Following code shows an example for a parameterized test. It tests sum() method of the ...
Read more >Parameterized JavaScript Steps
The mabl desktop app 1.4.2 release brings major improvements to JavaScript steps! Now you can define parameters in one-time or reusable JavaScript snippets....
Read more >Parametric Equations: Eliminating Parameters - Softschools.com
Step 1: Solve one of the parametric equations for the parameter · Step 2: Substitute the resulting expression for the parameter into the...
Read more >4 Steps to Creating a Parameter - The Data School
4 Steps to Creating a Parameter · Step 1 – Create the Parameter · Step 2 – Show the Parameter Control · Step...
Read more >Step Definitions - Cucumber Documentation
Suggested snippets will use your own parameter types if they match parts of your undefined step. If a color parameter type exists, Cucumber...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The purpose of our DSL is an explanation of the business process in mostly human language. Coupling values to it is a mistake in my opinion. There is a lot of places where we could put constants in Python. Making story spec one of them isn’t what I want.
Because sugar is what makes open source libraries so sweet.
Seriously though, typing less is always an objective when creating libraries.