-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Selecting Features/Scenarios at run time based on external data. #416
Comments
I may not have understood your need correctly, in that case please follow these instructions: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue here's what I suggest. don't use excel - read this answer on stack overflow: https://stackoverflow.com/questions/47954754/how-to-read-input-data-from-an-excel-spreadsheet-and-pass-it-json-payload-in-kar/47954946#47954946 all you have to do is dynamically create a JSON and then iterate over it and call features. so now you have control over the features you need to execute. |
Hi @ptrthomas, Thanks for the reply and sorry for the confusing requirements. My need is simple. Kindly let me know if it is possible to have this feature. Thanks, |
my answer is simple: no
but seriously, i suspect you have not understood karate enough. i have suggested a much more elegant solution above. honestly i have never heard of this assumeTrue you speak of. anyway, if you are insisting that we make some Java method available (not clear why) the answer is no. look for alternate options please.
… On 12-Jun-2018, at 4:03 PM, svarunbe ***@***.***> wrote:
Hi @ptrthomas,
Thanks for the reply and sorry for the confusing requirements.
My need is simple.
I would like to skip my feature or a scenario based on a flag at run time.
In Junit, there is AssumeTrue(false) method. I expect this feature to be available in karate.
Kindly let me know if it is possible to have this feature.
Thanks,
Arun Kumar V
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @ptrthomas, I understood that your provided solution is for handling data inside a feature. My concern is that I have 200 feature files and I want to run few of them at a given period. Could you please clarify how to do this other than hardcoding the list of feature files in the Runner.java. Sorry to ask many times, I'm trying to learn karate better. Thanks. |
i don’t think you still read the stack overflow link i posted. please.
- karate can call other features from a feature (refer doc)
- karate can loop over a JSON array and use each row to build a call
any questions ?
… On 12-Jun-2018, at 5:13 PM, svarunbe ***@***.***> wrote:
Hi @ptrthomas,
I understood that your provided solution is for handling data inside a feature.
My concern is that I have 200 feature files and I want to run few of them at a given period. Could you please clarify how to do this other than hardcoding the list of feature files in the Runner.java.
Sorry to ask many times, I'm trying to learn karate better.
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @ptrthomas, I have read the documentation and I am spending my last 15 days exploring Karate framework.
Sorry to insist my use case again. This could be common scenario in most of the organisation.
I beleive that this could be acheived if there is a provision to skip a feature or scenario at run time. kindly have this checked. https://groups.google.com/forum/#!topic/cukes/sl_LVlFJ8EQ Thanks. |
sorry both the links above don't work.
yes. but you are achieving your goal of testing a bunch of features. right ? anyway, I understand that you might be particular that you want a report broken down by different features. personally I think you are over-engineering your tests but I agree that this is a good feature to have so have opened #417 but I have one question for you:
Skipping features is fine, but how do you intend to skip a Scenario unless you use tags ? Sorry please don't say that it should be via JUnit. waiting for your reply. |
Hi @ptrthomas, Thank you for accepting this feature. The link is working fine when copy and paste in browser tabs. I am not sure why it is not working when directly clicking at them.
The rationale behind this is that, I have 100 scenarios within a feature, and I don't want to run all of the 99 scenario and background steps if my first Scenario fails knowing that rest 99 scenarios will fail. Because running a single features takes 30 - 40 minutes and we have 200 feature files. We dont want to wait that longer to know that the api endpoint url is wrong. As we cannot change our tag values dynamically, there should be a mechanism to mark the scenario as skipped like "karate.skip" or like throwing a skip exception. This way we can control our scenario execution even from outside of runner file. Thanks, |
@svarunbe thanks for being clear :) I think you have what you need - this is an undocumented new feature of Karate which I feel is too dangerous - but maybe you can prove that this is useful. you can call so in your case, if you have set a flag, you can do: * def condition = true
* eval if (condition) karate.abort() I'm going to release a 0.8.0.RC7 in a few minutes and would like you to test it. the API to choose features is ready |
Great. Will check it up and update you. Thanks |
Hi @ptrthomas, While using Karate.abort(), I have found out that the step result is marked as 'Undefined'. Because of this, Cucumber-report considered the skipped scenario as 'Failed'. Could you please change the step result for the karate.abort() as well as the steps below to it as 'skipped'? Thanks, |
ok. raise a ticket. |
@svarunbe and can you please do some research if needed and confirm if "Skipped" will also cause the same problem. should we go with "Passed" ? |
@ptrthomas I have checked on few reports implementation that if all the steps in a scenario is marked as skipped, they will mark the scenario as 'Skipped'. I think we should not go with 'Passed' because it will show the wrong number of passed scenario count. |
@svarunbe the "Undefined" thing is fixed. can't commit on when we make the next release so you can try and build from source if needed. can't help observing that you also haven't had the courtesy to confirm if everything else is working as expected. we'll wait in case you come up with some more demands. |
Thanks for the fix. As for as feature request, I have few in mind.
I will add if anything else needed. Thanks, |
@svarunbe please take your time :)
no we will not support this. refer cucumber/common#79
interesting suggestion. please refer this duplicate ticket and add your comments if necessary: #397 |
Sorry for taking this long time. Regarding the karate.abort() Is it possible to mark the rest of the step result as 'SKIPPED'? Thanks, |
@svarunbe which version. if you have tried 0.8.0.RC8 and still have an issue I need to be sure I understand what you are saying and what the issue is. so if you want any changes now, you HAVE to follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue |
Hi @ptrthomas, Yes I have tried with 0.8.0.RC8 and the issue was present in it. Thank you for the fix. |
Hi @ptrthomas,
Karate is really a robust framework for web service testing. We are currently using this framework at our organisation for the feasibility study. However, I am facing few challenges when utilizing this framework effectively. Please help if you can solve these challanges.
We have basically multi-country multi-service structure and we have written each feature file for each service. After done writting, we want to execute few services in a particular country. We cannot take help from tags since the country-service mapping is dynamic and we have an excel matrix for this use case. More over, we cannot edit the source code or feature file once it is pushed to server.
My requirement is that either I should pick up the all the feature files based on the excel matrix and run them or Once a feature is picked up, I should check whether it exist in excel matrix and if not, I should be able to skip the feature. (The feature should not be marked as failed in the report as I did not run it)
The same requirement is present for Scenario level. I should be able to control from excel data ( simple yes or no flag).
On exploring this option in google, ## I find that JUNIT AssumeTrue(false) will mark the scenario or feature as skipped in normal cucumber-jvm runner. But the same is not happening in Karate. It is marking the scenario or feature as failed. Hence I understood that this can be an issue or missing featur in karate.
Kindly look into this use case and advice if any solution is available.
Thanks,
Arun Kumar V
The text was updated successfully, but these errors were encountered: