The WebdriverIO demo shows how to use WebdriverIO for integration testing a yFiles for HTML web application.
To run the integration tests:
- Ensure that the demo server is running, see The Demo Server.
- 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. Please note that the tests
will fail if the corresponding browser binaries cannot be found on your system. If you
want to see the gestures that are being tested, you can disable the "headless" options
wdio.conf.js and add an
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 yFiles API is exposed globally when the application runs in the test environment.