You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kudos once again for this addon, it works so well with the latest builds of CKEditor and I'm using it with a custom build and some customizations.
I'm trying to write some sanity tests for my app and I'd like to test the editor using QUnit.
I did a bit of digging and the typeIn helper actually works with contenteditable fields, discussion here: emberjs/ember-test-helpers#793
As far as I can tell, at its core the editor has a contenteditable field, something along these lines:
I've tried writing a test to simply enter some text
test('Clear Text',asyncfunction(assert){// Set any properties with this.set('myProperty', 'value');// Handle any actions with this.set('myAction', function(val) { ... });awaitrender(hbs`<MyWhiteboard />`);awaittypeIn('.ck.ck-content.ck-editor__editable','This is a test');assert.dom('button.clear-text').exists();awaitclick('button.clear-text');});
From what I can tell, it finds the element and fires off all the events but nothing ever appears in the editor.
I was very optimistic that something would work, but unfortunately every avenue leads to a dead end.
The typeIn helper does indeed work with contenteditable fields but not with CKEditor. I'm not sure if the keystrokes are even making it or just bouncing off but somehow CKEditor seems impervious.
CKEditor's own tools are unusable because they can't be loaded alongside the main build, leading to double inclusion errors. Plus they are useless for simulating user input, just getting and setting the editor contents.
Trying to trigger pure JS events also doesn't work, plus it's difficult to integrate such behaviour into testing.
Exposing the editor to the test suite somewhat works but it leads to promise hell because you need to attach a testing-only action to the component and wait for it to execute after render.
In other words this part of the QA is dead in the water unless we can better understand the CKEditor internals and perhaps write our own helper but I'm not optimistic about it all unfortunately.
Even so, this plugin is top notch and has really helped us integrate CKEditor into our app.
Kudos once again for this addon, it works so well with the latest builds of CKEditor and I'm using it with a custom build and some customizations.
I'm trying to write some sanity tests for my app and I'd like to test the editor using QUnit.
I did a bit of digging and the
typeIn
helper actually works withcontenteditable
fields, discussion here: emberjs/ember-test-helpers#793As far as I can tell, at its core the editor has a contenteditable field, something along these lines:
I've tried writing a test to simply enter some text
From what I can tell, it finds the element and fires off all the events but nothing ever appears in the editor.
As I write this now I'm starting to wonder if we ought to use CKEditorInspector or something like the
getData
andsetData
helpers. (https://ckeditor.com/docs/ckeditor5/latest/framework/guides/development-tools.html#testing-helpers)I'll give it a try and follow up!
The text was updated successfully, but these errors were encountered: