Convert ckEditor5CodeSyntaxTest to WebDriver test

Created on 2 April 2025, 3 days ago

Problem/Motivation

We are trying to deprecate node_add_body_field in 📌 Deprecate node_add_body_field() Active but currently NodeTypeForm is calling this for the testing profile (since 📌 Remove node_add_body_field from NodeTypeForm Active ) just for these Nightwatch tests.

In 📌 Consider dropping Nightwatch in favor of Functional Javascript tests Active I think we all agree that Nightwatch is unreliable, and looking at the tests they are doing an awful lot of costly operations via the UI that if it were a PHP test we could use API to do for us (install the site, install modules, set up content types, etc).

Instead of adding even more UI clunk to Nightwatch in order to setup a body field, let's just convert these to WebDriver tests. There's nothing in there that can't be done in PHP afaict.

Proposed resolution

Convert ckEditor5CodeSyntaxTest to a WebDriver test.

Remaining tasks

Do it

📌 Task
Status

Active

Version

11.0 🔥

Component

ckeditor5.module

Created by

🇦🇺Australia acbramley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @acbramley
  • 🇦🇺Australia acbramley

    So this one is quite easy to do in PHP, except that I can't figure out how to actually type in the editor which we need to prove that adding the code block adds the specific class/markup. Without typing anything, CKE returns no data.

    I need to move on for today so have pushed what I've got so far.

  • Pipeline finished with Failed
    3 days ago
    Total: 160s
    #463909
  • 🇦🇺Australia mstrelan

    Honestly I don't know why we need to be testing the behaviour of the codeblock plugin. This is provided by CKE5 core and is thoroughly tested there. We should only be testing that we can configure the languages, and that the languages get passed to the plugin. I'd argue we don't need a JS test at all for this, but I guess a basic smoke test that the plugin is loading and the configured languages are available would be reasonable.

  • Pipeline finished with Canceled
    3 days ago
    Total: 70s
    #463935
  • 🇦🇺Australia acbramley

    Absolutely agree with #4, I was actually trying to find which part of drupal was adding those tags we're testing in the nightwatch test. Seeing as it's the CKE5 plugin itself, we don't need the drama of testing it ourselves.

    I've also added return types to 4 functions in CKEditor5TestTrait that were flagging new violations in the new test class. This means we can remove 240 lines from the baseline.

  • Pipeline finished with Success
    3 days ago
    Total: 582s
    #463936
  • Pipeline finished with Success
    3 days ago
    Total: 1085s
    #464034
Production build 0.71.5 2024