WebdriverIO Demo
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
demos-ts/testing/wdio. - Run
npm install. - Run the integration tests with
npm run test.
The application under test is the Simple Testable App. To access yFiles via WebdriverIO, the GraphComponent is set as a global variable in that application.
The application starts with a graph with two nodes, but graph items can be created interactively. The integration tests check 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
in
wdio.conf.js and add an await browser.debug()
statement
at the end of a test in the spec file.