| Functional tests that check something happening in the background (e.g. an auto-save) have to wait for it, and today they do so with getDriver() calls in the test class (raising the driver timeout, polling with waitUntilCondition), which breaks the page-object boundary: the test shouldn't need to know how long to wait or how to poll. Add test APIs that do the waiting themselves:
- TestUtils.RestTestUtils#waitForNewVersion(reference, version, timeout): wait for a document to move past a given version, polling it over REST (so it works whichever browser tab, if any, saves it), and return the new version. It throws a TimeoutException otherwise, which also lets a test check that no new version is created.
- BlockNoteEditor#waitForAutoSave() and BlockNoteEditor#isAutoSavedWithinNextInterval(): wait for / watch the auto-save, with timeouts derived from the interval set through setAutoSaveInterval().
AutoSaveIT is the first user: it no longer calls getDriver(). |