-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
E2E tests: Cypress not using type() properly on contenteditable elements #4089
Comments
@karmatosed can we ask someone from TinyMCE for help here? |
<br data-mce-bogus="1">
I found a workaround for removing the This does bring a different problem though, as it doesn't move the cursor with the text, even if you use |
Update: I found a bug in Cypress which is only causing this caret/cursor issue for You can see cypress-io/cypress#1108 for more details. |
Typing in cypress seems to be all simulated events, it does not update the window selection so anything that tracks the cursor (like the quick inserter) does not work. I have a branch where I implemented selenium tests which work correctly: So far I have had nothing but push-back on Selenium testing though (despite it being the defacto standard). |
Thanks for your input @EphoxJames !
In my Cypress tests, typing works well in many blocks, specifically any that use an I agree Selenium is the current defacto standard, but having compared it to Cypress, I prefer Cypress because of the ease of use, the code reads better, it's easier to learn (better documentation), and it has some advanced features like the DOM timeline inspector that is really nice for debugging issues especially with things like Gutenberg. Cypress will be the testing of the future, so I think it makes sense to start there and help it grow alongside Gutenberg. That's just my personal opinion! If Cypress doesn't fix the current issues, we will have to look at something like Selenium or rely on more manual methods for now. I'm curious to hear from others over their preferences for E2E testing and what they think. |
The selenium docs for javascript aren't that bad but strangely they are very hard to find: |
We decided to discontinue our journey with Cypress.io and start a closer relationship with Puppeteer. See #5618 :) |
Update: see the latest comment.
Issue Overview
When running our e2e tests to create blocks, the
<br data-mce-bogus="1">
is not being removed from the Block content, so our blocks are not created with proper formatting.Steps to Reproduce (for bugs)
002-adding-blocks.js
test from/test/e2e/integration/
type()
function to type into the blocks<br data-mce-bogus="1">
from the blocksChrome 63, also tried using Electron on Chromium 58
Latest
master
of GutenbergExpected Behavior
TinyMCE adds this
<br>
as a placeholder, and when you start typing it's removed. I'm guesing it checksisEmpty
to know when to keep it there and then when it's no longer empty, it removes it. I would expect this to also happen when running an e2e test.Current Behavior
<br data-mce-bogus="1">
not removedPossible Solution
Screenshots / Video
The text was updated successfully, but these errors were encountered: