I am wanting to run a async function which will fetch the data for testing. This data is then passed to Data() hook in codeceptjs.
I have tried hooks and event listeners like "Before(), BeforeSuite() and event.all.before" and even a customized event listener but all seem to execute after the Data() hook. Putting the feature and scenario inside a function where fetch method is called before feature and scenario is also not working.
Async fetch call => Data() hook is called => Scenario is executed.
This is the flow of functions I am wanting.