The WebdriverIO demo shows how to use WebdriverIO for integration testing a yFiles for HTML web application.
To run the integration tests:
Go to the demo's directory
Run the integration tests with
npm run test.
The demo starts with an empty graph, but graph items can be created interactively. The integration tests test this functionality by simulating node, edge and port creation gestures and verifying that the graph instance actually contains the newly created graph items.
Tests are run in both Firefox and Chrome in headless mode. If you want to see the gestures that are being
tested, you can disable the "headless" options in
wdio.conf.js and add an
statement at the end of a test in
the spec file.
In order to obtain access to the yFiles API, in particular for access to the GraphComponent instance through CanvasComponent#getComponent, the server used in this sample injects a variable that causes the application code to expose the yFiles API to the global scope.