-
Notifications
You must be signed in to change notification settings - Fork 675
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
contenteditable="false" on Placeholder of CodeMirror component prevents input via typeText #7837
Comments
We appreciate you taking the time to share the information about this issue. We replicated it, and it is currently in our internal queue. Please note that the research may take time. We'll update this thread once we have news. |
We appreciate you taking the time to share the information about this issue. We replicated it, and it is currently in our internal queue. Please note that the research may take time. We'll update this thread once we have news. |
I managed to overcome the issue with a workaround. The cause of the incorrect behavior is in the placeholder import { Selector } from "testcafe";
fixture('code mirror issue').page('https://8k9pct.csb.app/');
test('reproduce code mirror issue', async (tc) => {
await tc
.click(Selector('div#placeholder').find('div.cm-content'))
.pressKey('d')
.typeText(Selector('div#placeholder').find('div.cm-content'), 'dd')
.debug()
}); The trick is that before typing we focus our editable content element and execute the |
Thanks! @AlexKamaev you said that testcafe currently can't handle this use case, is it planned to support such functionality in the future? |
Appreciate the workaround, thanks!
It's possible to include it, but for sure it has some side effects (e.g., the additional character / keyDown event is triggering additional behavior). Other then that, think about a normal development workflow. We have an existing TestCafe based test that types into a CodeEditor field without a placeholder. Someone adds a placeholder to this CodeEditor field, which will make an existing test fail, as TC is no longer able to type a text into this field. It's not obvious to the developer as to why the test fails. |
During tryouts, i saw that the workaround is only working when native automation is activated. Any chance to get this workaround for proxy mode? |
@christian-kreuzberger-dtx @Thomas-Haider
I did not manage to make the workaround work in proxy mode. |
What is your Scenario?
We want to type text in a code mirror components that has a placeholder defined.
What is the Current behavior?
Input in code mirror component only works when no placeholder is defined or when we manually override contenteditable property of the placeholder dom element and then input the wanted text.
What is the Expected behavior?
I would expect that with testcafe I can enter text into code mirror components that have a placeholder defined without manipulating a dom element.
What is your public website URL? (or attach your complete example)
https://codesandbox.io/s/winter-glitter-8k9pct?file=/src/App.js
What is your TestCafe test code?
It is reproducible in the following example:
Your complete configuration file
no config file used
Your complete test report
Screenshots
No response
Steps to Reproduce
testcafe chrome ./test.spec.ts --live --skip-js-errors
--skip-js-errors
is not related to the issue. That is just needed due to an issue on the code sandbox.TestCafe version
3.0.0
Node.js version
16.18.1
Command-line arguments
testcafe chrome ./test.spec.ts --live --skip-js-errors
Browser name(s) and version(s)
No response
Platform(s) and version(s)
No response
Other
When you look at the screenshot below you see that the contenteditable property is only set to false on the placeholder and is set to true on the code mirror component. Logically, this means I should be able type something there but sadly, TestCafe is checking also child components for that value and therefore, prevents me from typing something.
The text was updated successfully, but these errors were encountered: