Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25221

Make the CKEditor test page objects wait for the content refresh after inserting or editing a macro

    XMLWordPrintable

Details

    • Integration
    • Unknown
    • N/A
    • N/A

    Description

      Functional tests using CKEditor currently have to wait themselves for the edited content to be refreshed after a macro is inserted or edited (e.g. textArea.waitForContentRefresh() right after macroEditModal.clickSubmit()), as well as hand-code the quick action (slash command) sequence (AutocompleteDropdown + waitForItemSelected + Enter + waitForItemSubmitted). Test writers must know which actions trigger a server-side re-rendering and forgetting the wait leads to flickering tests.

      The page objects should do these waits themselves, so that tests don't have to:

      • submitting the macro edit modal opened from the tool bar, the balloon tool bar, or by pressing Enter on a selected macro waits for the macro to be re-rendered
      • new RichTextAreaElement APIs to insert a macro using a quick action (insertMacro(), insertMacroWithRequiredParameters()), to edit the selected macro (editSelectedMacro()) and to execute a quick action (executeQuickAction())
      • the existing functional tests (CKEditor, in-place edit, realtime WYSIWYG) are updated to rely on them, keeping only the waits that only the test can know about (e.g. remote changes from another realtime editor)

      This is a first step towards removing waits from functional tests (see the "Page objects" best practices at https://dev.xwiki.org/xwiki/bin/view/Community/Testing/DockerTesting/#HBestPractices).

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: