This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-f90ebb45-86da-42eb-affe-b6086ec5e69e XWIKI-25214 Open

Add test APIs to wait for the BlockNote auto-save and for a new document version over REST

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-2589fc79-39a2-405f-8985-db19dca3f93b Vincent Massol created this issue on 08/Oct/26 12:46
 
Summary: Add test APIs to wait for the BlockNote auto-save and for a new document version over REST
Issue Type: cid:jira-generated-image-avatar-f90ebb45-86da-42eb-affe-b6086ec5e69e Improvement
Assignee: Unassigned
Components: Test Framework
Created: 08/Oct/26 12:46
Priority: cid:jira-generated-image-static-major-5ef06623-05f7-4381-91a8-c908581680ff Major
Reporter: Vincent Massol
Description:

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().

 
 

1 update

 
cid:jira-generated-image-avatar-2589fc79-39a2-405f-8985-db19dca3f93b Changes by Vincent Massol on 08/Oct/26 12:46
 
Assignee: Vincent Massol