-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Get The Step Name & Number Of A CucumberJs Step & Set The Result Of A Step #719
Comments
What exactly does "From a JavaScript step" mean exactly? There is setDefinitionFunctionWrapper that may be able to be useful but I'm not sure. I am not involved in the protractor project and thus this is wrong place to look for help with that. I am open to work with someone from the protractor team to help build that out but that would belong in the protractor repo anyway instead of here. |
Lol sorry about the confusion. That is very vague my apologies. So a JavaScript step would mean from my perspective as the JavaScript equivalent of a cucumber feature step i.e. Given A User Navigates To The Login Page this.Given(/^A User Navigates To The Login Page$/, function () { }); so ideally I would be able to get the step name, step number & possibly set the step result from within the world context if that makes sense. This function you mention is that only available to cucumber 2.0 plus? That's a fair enough point you make about protractor just curious. |
Maybe see registerHandler is does not allow you to set the step result but you can view step names, track the step number yourself, and view step result.
Correct |
Hey @charlierudolph Many thanks for your comments above. They were very useful. I have two more questions for you if you don't mind. To give you some context I want to be able to put manual testing through the framework, hence all the questions. I have three hook functions listed below var _this = this; Is there anyway to assign a name to them so when I call the following code within an EventHandler function i.e. function BeforeStep(event, callback) {
} as event.getName returns 'undefined' for each of those. If not no worries, I can work around that so to exclude steps that get processed as hooks. to set the result of a step definition manually in the framework I'm assuming I can do the following: return Cucumber.Status.PASSED; or one of Status.AMBIGUOUS, Cheers, ~Bhréin |
|
So I have two use cases
So based on the XML i.e. Result attribute I want the framework to set a test step in the framework for a manual test case, so that I get for free the same JSON produced at the end of a test run. so Pass will be a cucumber equivalent etc. Hope I'm making sense? Btw |
I'm sorry @bhreinb but I would rather not support the use case for number 2. That would open up too much of the internals in my mind just in order to give you the "same JSON produced at the end of a test run". |
Okay thanks for your help with this. |
Sorry for the bother again...but I seem to be having an issue overriding a tagged hook timeout _this.After([{tags: '@Aca_Ipmf_02'}, {timeout: 90 * 1000}] ,Aca_Ipmf_02); Basically what I'm trying to do is exercise the backend APIs via this hook. As there is a lot of data been sent when exercising the API it can take longer to complete than the default timeout of 30 seconds. I need to keep default timeouts to be 30 seconds for other non-angular tests that are done via the framework. However, it never respects the timeout I set on the hook. I have tried a few variations of the signature above to no avail. Sorry to bother again and I appreciate any suggestions on the above. |
See the api reference docs. The tags and timeout should be in a single object (and no array) |
Hey thanks a mill...here is the construct that worked for us this.After({tags: ['@Aca_Ipmf_02'], timeout: 90 * 1000}, function (scenario) { this construct threw an exception this.After({tags: '@Aca_Ipmf_02', timeout: 90 * 1000}, function (scenario) { |
Are you on version 1.3.1? Sorry my answer for for 2.0.0-rc.6 |
I'm on 1.3.1. I'd love to upgrade at a later stage but to do that I'd need compatibility with protractor. |
Hi @charlierudolph sorry to initiate an old thread again. Suppose I have a cucumber step something like the following....
Is it possible via a cucumber API to get the regex equivalent of an individual step?
I know you have a capacity to print empty steps to the stdout via dry-run parameter but I'm looking for a translation at a more granular level if that makes sense. Appreciate any guidance on the above. |
I also would like to have the step information in the setDefinitionFunctionWrapper function. Still not clear how to achieve this? Do you have an example how to for example log this info in a setDefinitionFunctionWrapper function? Thanks! |
@danielvanmil Did you figure it out? I am looking for the same thing and could not find it anywhere |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi there,
I know this is an issue repository but I'm hoping you can help answer the following question as i'm unsure whether the framework supports this. The question is as follows
I would like get the following information from cucumber.js at runtime
I have cases whereby I would like to override the result provided by framework. Is any of the three steps possible. I'm currently using cucumber@1.3.1. Btw I see there is cucumber 2.0.0 currently been developed. Will their be sample code on how to use with protractor, as I use cucumber.js initiated through protractor. Many thanks in advance.
The text was updated successfully, but these errors were encountered: