-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the Cypress .type()
command with v35.3.0 throws an Error
#12802
Comments
We are getting the same issue except we are using a Selenium-based driver for our tests. Everything isn't behaving correctly anymore in our automation. Unfortunately this is something which is blocking us from upgrading. Did all typing scenarios get migrated to |
Actually correction... Seems like some of the quirks from CKE5 that our E2E tests tried to get by was fixed in 35.3.0 after all this time. Looks like migration to beforeinput helped. After removing our "workarounds", things were working as expected again. However, there are still behaviors which changed in that still cause our own automation to fail. |
Hi @slotterbackW, in our e2e tests written in Cypress we use commands from cypress-real-events package. This package exposes the Using Unfortunately, using the As for the Selenium-based testing, we are not able to give any insights or tips on how to approach testing CKEditor 5 as we are not using such tools in our tests. |
Thanks for the feedback and sorry for the inconvenience! I have to admit, I may have underestimated the implication of some of the changes we made. For instance, I completely haven't thought about E2E tests. Perhaps this should've been at least marked as major BC in our changelog. One issue with this project was that it took so long (~2y from the start) that we lost track of some of the less-apparent breaking changes. So, the changelog may also be missing some parts. I'll let the team know about this issue thread and we'll keep monitoring other issues as well. So if you'll run into any issues, let us know – we may be able to share some tips (just like @LukaszGudel did above) or even bring back missing things in future releases. |
Yes, all of them. We could theoretically bring back mutation handler, but we were happy to actually remove it as it was a complexity hell. And it wasn't super stable either. Thus, e.g. spell checker uses the On the other hand, I suppose that Grammarly doesn't have a CKE5-specific integration (although, I'm not 100% sure). And it works with the newest version of CKE5. Maybe, @niegowski, could you check how it operates? |
Thanks @Reinmar for that insight, and for hearing me out. It is very appreciated. I don't want to steal away the discussion and will try to continue here: #11636 as I think it is more relevant. It would be great to see how other integrations do it, but unfortunately for us, I'm not sure about the flexibility in accommodation for our CKE5 integration. (This spell checker/grammar correction is used in more than just our application) |
We moved the discussion about Microsoft's spell/grammar checker to #12844. |
I'm having this problem. From what I can tell the solution right now is to use cypress-real-events. Is this correct or does exist an official workaround for this? |
.type()
command with the newest version of CKEditor throws an Error.type()
command with version 35.3.0 throws an Error
.type()
command with version 35.3.0 throws an Error.type()
command with v35.3.0 throws an Error
Thanks @LukaszGudel for the workaround! It was a decent amount of work to migrate our tests to use cypress-real-events since the API is not exactly the same, but we were able to migrate all our tests and upgrade to this version. I did want to mention though that now that we've upgraded, our logs are showing that many of our users are running into the same error:
Unfortunately, so far, using Cypress's |
We were running into the same issue using Testcafe. Our solution was to simulate the
To be honest, I'm far from an expert when it comes to the I hope this is helpful. |
Not sure if thats related, but after I bump CKEditor5 from v35.0.1 to v35.4.0, any |
We have issue using cypress. We ended up using the below with @DerJacques 's solution inside
|
Our tests have also started failing from v35. We rely on Ember's test-helpers fillIn which no longer finds/fills in text in the editor. |
Is there a fix for this yet? We have upgraded the ckeditor last week and now tests are failing. Edit: Fixed with the plugin suggested by @LukaszGudel, even though I would prefere a solution without using a plugin. Replaced |
Wow, this took me a ton of debugging to finally track down - would love for this to be fixed asap 🙏 This was my eventual workaround for now based on ckeditor's FAQ about DOM element's ckeditorInstance, but really we need Before cy.get('.ck-content[contenteditable=true]').type('Typing some stuff') After cy.get('.ck-content[contenteditable=true]').then(el => {
const editor = el[0].ckeditorInstance // If you're using TS, this is ReturnType<typeof InlineEditor['create']>
editor.setData('Typing some stuff')
}) Also...I was using ckeditor v36.0.1 and still seeing the issue |
What I'd propose to do here:
The other option:
|
Your workaround worked for me, thanks very much. I have realize that you can recover ckeditor object so you can use set method... here you are another workaround:
|
To achieve this, we had to _build from source_ Note we are trapped below the latest version - past about V34, ckeditor crashes in cypress (although it runs fine in localhost) - probably the same cause as in ckeditor/ckeditor5#12802
ckeditor/ckeditor5#12802 npm i @ckeditor/[email protected] npm i @ckeditor/[email protected]
ckeditor/ckeditor5#12802 npm i @ckeditor/[email protected] npm i @ckeditor/[email protected]
ckeditor/ckeditor5#12802 npm i @ckeditor/[email protected] npm i @ckeditor/[email protected]
📝 Provide detailed reproduction steps (if any)
We're super excited about the newest CKEditor release that adds support for the beforeInput event, however, when trying to upgrade we noticed that with the newest version (v35.3.0) many of our Cypress tests have started failing.
It looks like the issue is due to how Cypress's type command interacts with CKEditor. Any call to
type()
, which includes typing letter keys (i.e. not just{rightArrow}
), results in the following error:✔️ Expected result
The type command works normally
❌ Actual result
JS error
❓ Possible solution
If you have ideas, you can list them here. Otherwise, you can delete this section.
📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: