Felipe Nava Covarrubias
2018-10-12 00:30:21 UTC
Hey guys,
I have been working with cucumber + ruby a long time and now we are
migrating to nightwatch + cucumber. But I have been searching in a lot of
places how can I pass the values that are in my example table through my
hook before method.
So, the reason for this is because before of each execution I wants to do
some logic and I need to get data from my example table to be able to do
that.
Let's put this as an example:
*test.feature*
@something
Scenario Outline: Verify user can go all sites
Given A user visiting <site>
Examples:
| site |
| google.com |
| gmail.com |
*hooks.js*
const { Before, After } = require('cucumber');
Before(function (scenario, callback) {
console.log('Here I wants to know what are the values of my example table for this specific execution...');
});
As I put in the console.log, I would like to get in that place the value in
each execution of the parameter "sites". So that in the first execution
somehow I need to know that we are runing the test scenarios with the valur
"google.com" in the variable "sites", then in the next execution that would
be "gmail.com", and so on...
I have been checking in all the parameters that comes in the scenario but
not luck. If someone knows how to do this or knows any document/blog/post
that already found the answer for this, please just let know.
Thanks and appreciate your help!
I have been working with cucumber + ruby a long time and now we are
migrating to nightwatch + cucumber. But I have been searching in a lot of
places how can I pass the values that are in my example table through my
hook before method.
So, the reason for this is because before of each execution I wants to do
some logic and I need to get data from my example table to be able to do
that.
Let's put this as an example:
*test.feature*
@something
Scenario Outline: Verify user can go all sites
Given A user visiting <site>
Examples:
| site |
| google.com |
| gmail.com |
*hooks.js*
const { Before, After } = require('cucumber');
Before(function (scenario, callback) {
console.log('Here I wants to know what are the values of my example table for this specific execution...');
});
As I put in the console.log, I would like to get in that place the value in
each execution of the parameter "sites". So that in the first execution
somehow I need to know that we are runing the test scenarios with the valur
"google.com" in the variable "sites", then in the next execution that would
be "gmail.com", and so on...
I have been checking in all the parameters that comes in the scenario but
not luck. If someone knows how to do this or knows any document/blog/post
that already found the answer for this, please just let know.
Thanks and appreciate your help!
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.