Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Conditional execution of Steps #661

Open
chegancasb opened this issue Apr 10, 2024 · 2 comments
Open

[Feature Request] Conditional execution of Steps #661

chegancasb opened this issue Apr 10, 2024 · 2 comments

Comments

@chegancasb
Copy link

In my team we use ZeroCode to support our component tests - where we validate the integration of our components against the services it interact with (some are real others mocks).

Given our use case, not knowing if more peoples have similar needs, I would propose the following.

We use the same scenario files in different use cases and some of those require specific actions to be done prior to each test. Currently we do have a way to incorporate this in scenario files because including those actions break some use cases.

The way I see this is to have additional step properties that determine if the step is or not evaluated. Something like:

   (...)
   {
       "name": "adjust setup to local execution",
        "url": "com.example.my_component_component_testing.helpers.db.SQLExecutor",
        "method": "sqlFileExecutorNoWait",
        "request": "/setup/update_db_for_local.sql",
        "assertions": {},
        "apply": "${config.is_component_running_locally}"
   },
   (...)

where we implement a new optional parameter (apply in the example above) that by default is resolved to TRUE but if defined its interpretation would determine if the step would actually be executed.

In proposed example the step refers to a variable defined in the config_hosts.properties (config.is_component_running_locally) that would have to be interpreted to a bool value but it's execution could also be determined by a variable coming from previous steps.

For simplicity sake I am proposing that the variable value would be restricted to directly boolean values convertible strings but a discussion on more complex expressions might be worth.

Thanks for your attention.

@authorjapps
Copy link
Owner

@chegancasb , Have you looked at this(line no. 7) ?

"ignoreStep": true,

This seems might be helpful, but only partly to your usecase.

Because you needed this value config based, this doesn't seem like supports that.
But anyway give it a run and try, if it doesn't solve, we will raise a ticket to sort this.

@chegancasb
Copy link
Author

chegancasb commented Apr 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants