[xwiki/xwiki-platform] 368ea8: XWIKI-21612: Realtime WYSIWYG editor functional te...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-platform Commit: 368ea8eb6244530c3a33fbaaa762cc978c3f5088 https://github.com/xwiki/xwiki-platform/commit/368ea8eb6244530c3a33fbaaa762c... Author: Marius Dumitru Florea <[email protected]> Date: 2023-11-27 (Mon, 27 Nov 2023) Changed paths: M xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-test/xwiki-platform-ckeditor-test-pageobjects/src/main/java/org/xwiki/ckeditor/test/po/RichTextAreaElement.java M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-webjar/src/main/webjar/toolbar.js M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-test/xwiki-platform-realtime-wysiwyg-test-docker/src/test/it/org/xwiki/realtime/wysiwyg/test/ui/AbstractRealtimeWYSIWYGEditorIT.java A xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-test/xwiki-platform-realtime-wysiwyg-test-docker/src/test/it/org/xwiki/realtime/wysiwyg/test/ui/RealtimeTestDebugger.java M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-test/xwiki-platform-realtime-wysiwyg-test-docker/src/test/it/org/xwiki/realtime/wysiwyg/test/ui/RealtimeWYSIWYGEditorIT.java M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-test/xwiki-platform-realtime-wysiwyg-test-pageobjects/src/main/java/org/xwiki/realtime/wysiwyg/test/po/RealtimeCKEditorToolBar.java M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-test/xwiki-platform-realtime-wysiwyg-test-pageobjects/src/main/java/org/xwiki/realtime/wysiwyg/test/po/RealtimeRichTextAreaElement.java M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-webjar/src/main/webjar/filters.js M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-webjar/src/main/webjar/patches.js M xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-wysiwyg/xwiki-platform-realtime-wysiwyg-webjar/src/main/webjar/wysiwygEditor.js Log Message: ----------- XWIKI-21612: Realtime WYSIWYG editor functional tests are flickering in Chrome * The empty text area placeholder is not added / removed immediately, so we need to wait for it. * Store the user id (for the realtime session) in a data attribute on the realtime toolbar to simplify the wait for the user position inside the rich text area. * Output the JavaScript (browser) console logs and the realtime debug information on test failure. * Wait for a coeditor position before asserting the number of coeditor positions. * Empty space at the end of a text node can be converted to a non-breaking space. Refactor the tests to avoid it, so that the outcome is the same in Firefox and Chrome. * Fix the code that checks if a coeditor position (caret indicator) is in the viewport, so that it works on Chrome also. * Don't sync the focused block placeholder, because each coeditor can have a different focused block and also because it leads in some cases to patches that are not valid JSON and thus are dropped, failing the tests (timeout waiting for a specific content). * Filter the "filling character sequence" that is used by CKEditor to overcome the fact that we can't place the caret inside an empty element in Chrome (Blink / WebKit in general). This was generating additional whitespaces in Chrome that was failing the tests. * Make sure DiffDOM creates DOM nodes using the owner document of the edited content. * Perform operational transformation using Chainpad.NaiveJSONTransformer (used also by CryptPad) because we're synchronizing JSON content and also reject patches that are not valid JSON. thanks @yflory ! ** We also tried using SmartJSONTransformer but it doesn't behave as well when multiple users are editing in the same place (i.e. when multiple operations happen in close vicinity). * Improve logging when a remote patch fails to be applied or when a local change fails to be pushed to chainpad. (cherry picked from commit 988a9e2824f81f4fec3e0f91e1277ac5a2bfa345)
participants (1)
-
XWiki Notifications