You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 7, 2019. It is now read-only.
The World section of the Cucumber.js README demonstrates two ways to set the World that will later be provided to Steps. CukeFarm is hard coded to follow the first example: telling Cucumber.js to instantiate a World object. This means that only the Steps have access to the World out of the box, which causes issues if you write helper functions or Page Objects that also need access to properties on the World. The following questions should be answered by this ticket:
Should CukeFarm support the second example: providing an object and telling Cucumber.js to use it as the World?
Should the CukeFarm Step Defs that instantiate Page Objects be modified to pass the World object by default?
Expected outcome of this issue:
If the answer to question 1 is Yes, a new issue should be filed to add the described functionality.
If the answer to question 2 is Yes, a new issue should be filed to add the described functionality.
If the answer to both question 1 and question 2 is No, no further work is needed.
Note:
The current best practice for providing a Page Object access to the World is to define a new Step Def in your project that passes the World to the Page Object's constructor when it is instantiated.
The current best practice for providing the World to helper functions that are used by Step Defs is to use the Function.prototype.call() function when calling such helper functions in a Step Def. This will allow you to set the scope of the helper function to that of the Step Def. In this way, the syntax of the helper function can match that of the Step Defs.