-
Notifications
You must be signed in to change notification settings - Fork 3.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
Ace editor (cloud 9) fails cy.type() with element is covered #1818
Comments
This comment has been minimized.
This comment has been minimized.
You are using https://ace.c9.io/? Could you reproduce this issue, maybe trying to type on their example site, so that we have a reproducible example? |
Yeah I have tried the same in website ( https://ace.c9.io/ ) and encountered the same problem cy.get(".ace_text-input").first().type("#include") |
yeah even I faced the same issue, but since I have it only in one text box I worked around as below- cy
.window()
.its('myjs.path.expressionEditor' as any)
.invoke('value', 'text to be entered'); Hope it helps you |
this seems like a visibility bug, so I'm removing this from the |
I had the thought to use Clicking on the ace editor, while this focuses the input in the real browser, seems to have no impact in cypress. So, I tried having my application expose a button to programmatically bring up the editor's search dialog. Then I made cypress close it, which left the editor focused. then I used Any other ideas for a workaround? I'm not sure how to use the window workaround above... |
It works fine by using |
@ronlawrence3 I'll look into the failure in headless, it's probably a window focus issue |
This one is tricky. It actually is being covered by the other element, it('should type in input', function () {
cy.visit('https://ace.c9.io/build/kitchen-sink.html')
cy.get(".ace_text-input").first().focus().type("foo bar")
}) ace editor also has some fun focus logic of their own var focusEditor = function(e) {
var windowBlurred = !document.hasFocus || !document.hasFocus()
|| !editor.isFocused() && document.activeElement == (editor.textInput && editor.textInput.getElement());
if (windowBlurred)
window.focus();
editor.focus();
}; |
It works perfectly for me! Thanks, I was banging my head against the wall with this |
closing this since it's not a visibility bug, and has a workaround. |
Is this a Feature or Bug?
Cannot type in textarea using Cypress.
Current behavior:
As it has cover of div elements cypress gives an error.
Desired behavior:
Cypress should be able to type in the ace editor
This is the error that occurs if we use textarea with cypress type
The text was updated successfully, but these errors were encountered: