Assert what a CKEditor 5 field holds, through the editor's own data (the HTML it would save), so a link, a heading or an inserted media are checked where they live rather than on the rendered page.
Examples
Then the rich text editor field "Body" should contain "Hello"
And the rich text editor field "Body" should contain "href=\"https://example.com\""
Then the rich text editor field "Body" should not contain "<h1>"
And the rich text editor field "edit-body-0-value" should contain "<p>"
Then the rich text editor field "Content" should not contain "Draft"
Pattern
Then(/^the rich text editor field "([^"]*)" should( not)* contain "(.*)"$/, …)
Part of @webship-js/drupal-core-steps (github.com/webship/drupal-core-steps), a step pack for Webship-js 2.0.x.