-
Notifications
You must be signed in to change notification settings - Fork 120
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
Cucumber World constructor #10
Comments
you can use share context via: cy.wrap({ msg: 'Hello World' }).as('world');
// and in a later step
cy.get('@world') |
Thank you for your maintenance of this great library! Unfortunately the use of aliases is not sufficient for a more complex case, particularly when using TypeScript, for example, as in the following custom world constructor, `import FilterBusinessOptions from '../../businessOptions/filterBusinessOptions'; function CustomWorld() { export default CustomWorld` where 'business option' type definitions for the data structures each type of page object (if using page objects) or service method (and therefore step definition calling the service methods) can accept are defined in potentially multiple type definition files. This is very useful for storing the data input to various steps for use in subsequent scenario steps - yes, we could do it using aliases or the setTo() example you provided but for a large application there are multiple type definition files with dozens of data object type definitions, with defaults, that get initialized in the cucumberWorldConstructor, and which would be extremely cumbersome to maintain in a before() hook. Furthermore, the this.nav object stores instances of the instantiated page classes, and this.stackP maintains a dynamic array of the names of the visited pages (though suppose we could do that with the existing this, but Typescript would show warnings.) |
We are using your implementation and are quite happy but for our tests we need scenario isolated context.(like https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/world.md ) Do you plan to support it or know an way to make this happen ?
thx thomas
The text was updated successfully, but these errors were encountered: