MarvelJS Framework
Some things to know ...
Work started off based on C# ProductAlpha, but I began to look at Marvel and the aim was to work towards something a bit more like that.
cucumber.js requires files to be in certain folders. Therefore, if using the framework beforeScenarios and we want to use these functions, we need to add a hooks.js to the main test solution folder and import the beforeScenario. For example, create hooks.js and add a single line:
const hooks = require(../to/the/location/beforeScenarios)
Alternatively, you can use a world.js
to setup your global context per scenario.
Timeouts!!! Cucumber js hooks time out after 5000ms by default. If using a wait for element which may take longer than 5000ms, set in the function setup. For example, take note of the object containing 'timneout' after the function name.
Then("I wait for element {string} to become present", {timeout: 2 * 5000}, async function(element) {
Setting up page objects - to set up a page object for steps, instantialise via the background feature in cucumber.
Running the example tests
script tag has been added in package.json file from the terminal run:
./node_modules/.bin/cucumber-js test/features/**/FrameworkTest.feature -f json:report.json && npm run htmlreport
To generate the report in html format
from the terminal run:
node ./parent/core/reporting/generateReport.js