Closed aldarund closed 6 years ago
The first error message definitely looks unusual.
Could you provide an example of some html / tests that throw this error? We won't be able to investigate this issue without a reproducible example. If it is private code, try recreating the css/html just to reproduce the error.
@jennifer-shehane https://beta.tenantreport.net - here is url test that produce first error
it('Go to signup', () => {
cy.visit('/')
cy.contains('a', 'Try It Now').click()
cy.contains('button', 'Sign up')
})
test that produce second error
it('Fill signup page', () => {
cy.visit('/auth/signup/')
cy.get('input[name=landlordType]')
.click({ force: true })
.then(() => {
cy.contains('estate agent').click()
})
Both code work fine in 2.1.0
I am not experiencing this on my Mac in Chrome 67 or Canary 69. Will have to check in Windows/Chrome 68.
Are you running these tests in 'interactive mode' or by running it using cypress run
?
@jennifer-shehane cypress open. Here screenshot when i run agains that url : https://i.imgur.com/4s8aT95.png
@jennifer-shehane tried cypress run. This two test works fine with cypress run. But another bug -> https://github.com/cypress-io/cypress/issues/2044
3.0.2 still have same problem
I'm also having the same issue. Many of my tests broke when upgrading from version 2.x to 3.0.2 Errors are all very similar to each other:
CypressError: Timed out retrying: cy.click() failed because this element is not visible:
<button tabindex="0" class="jss104 jss89" type="button" id="new-ticket-button">...</button>
This element '<button#new-ticket-button.jss104.jss89>' is not visible because it has CSS property: 'position: fixed' and its being covered by another element:
undefined
Fix this problem, or use {force: true} to disable error checking.
CypressError: Timed out retrying: cy.type() failed because this element is not visible:
<input aria-invalid="false" aria-required="true" class="jss29" name="user" required="" type="text" value="">
This element '<input.jss29>' is not visible because it has CSS property: 'position: fixed' and its being covered by another element:
<label class="jss16 jss11 jss12 jss15" data-shrink="false">...</label>
Fix this problem, or use {force: true} to disable error checking.
https://on.cypress.io/element-cannot-be-interacted-with
We're aware of some issues regarding visibility that need refactoring. However in order to prioritize these issues we must have a reproducible repo.
Simply pasting the error is not enough. We have hundreds of tests around clicking and visibility, and need specific scenario's in which the algorithms aren't working.
Per your comment @Vitao18 we have no idea if this should even be happening or not. Is the element really being covered? Have you tried { force: true }
? Was this happening on 2.x.x
? Have you tried 3.0.1
? Does this happen in cypress open
vs cypress run
? Can you paste an animated gif? Can you send us your test code.
@brian-mann what about my reproducible example ? :)
I'm going off of what @jennifer-shehane said https://github.com/cypress-io/cypress/issues/2037#issuecomment-400464817
She usually takes the lead on reproducing issue.
Per your comment @Vitao18 we have no idea if this should even be happening or not. Is the element really being covered? Have you tried { force: true }? Was this happening on 2.x.x? Have you tried 3.0.1? Does this happen in cypress open vs cypress run? Can you paste an animated gif? Can you send us your test code.
@brian-mann thanks for the fast response.
My tests where passing in version 2.x.x.
They break when upgrading to version 3.0.1 or 3.0.2, both using chrome-67 or electron(both headless and headed)
It happens in cypress run but not in cypress open. I'll try to make a reproducible example and paste it here
Also, I haven't tried using force: true
as testings were passing before
@jennifer-shehane any luck replicating issue?
FYI... I just installed Cypress 3.0.2 (and then reverted back to 3.0.1) and going through the tutorial, I get the same "cover" error message on the following test in both cases.
describe('My First Test', function() {
it('clicks the link "type"', function() {
cy.visit('https://example.cypress.io')
cy.contains('type').click()
})
})
Finally started over with version 2.1.0 and it was successful. Something is odd here.
@larkintuckerllc what os are u using and what version of chrome?
Ok... Here is some more info...
OS: macOS High Sierra, Version: 10.13.5 Browser: Version 68.0.3440.59 (Official Build) beta (64-bit)
Shows up in Cypress as "Chrome 68". Here is the screenshot of the error:
note: I happen to know that I have not taken MacOS updates for a bit (will try that next).
Chrome 68 like in my case..
A bit more information... Upgraded OS to MacOS 10.13.6 (no change).
BUT... Downgraded my browser to: Chrome Version 67.0.3396.99 (Official Build) (64-bit)
And the test was successful.
I haven't downloaded and tested this in Chrome version 68.0.3440.59.
Version 68.0.3440.59 (Official Build) beta (64-bit) - thats mine chrome at this moment where cypress 3.0.2 fails, but 2.1 works. But when i reported it 21 days ago there was earlier version of chrome, since then chrome updated itself several times
Version 68.0.3440.68 (Official Build) beta (64-bit) - still not working :(
Im also experiencing the errors 'is being covered by another element <html lang="em"...'
Im on macOS Sierra 10.12.4
and using chrome Version 68.0.3440.75 (Official Build) (64-bit)
(Id thought this was also occurring on chrome 67 but not so sure now).
Error seems to occur for all 'interaction' commands like; click, select & type
Same here on Ubuntu 16.04
and Google Chrome 68.0.3440.75
. Downgrading to Google Chrome 67.0.3396.79
solves the issue.
I have the exact same thing after my Chrome updated to 68 version. Previously it was ok with 67 and Cypress 3.0.2. I haven't found a way to downgrade Chrome on Mac (haven't found any binaries on the web). What I did as a workaround: I switched on Cypress test runner to Electron 59 and it works fine now! Worry about my production tests as it is also using Chrome...headlessly though so maybe it's gonna work. Will check that and update my post here.
Now having this fail in our own Cypress project on Chrome version 68.0.3440.75. This error is not happening in Canary 70...which makes me feel like this is a Chrome error. Trying to track this down in their issue.
Working in:
Likely introduced between:
Working in:
Well, if it's chrome error why it work fine in Cypress 2? Also it certainly before build 59. At the moment I created issue there was either build 34 or 43 at that time.
Running into this same issue
Alright, I've narrowed down the issue. We recently added the --disable-blink-features=RootLayerScrolling
flag to Cypress on browser launch to fix this issue.
It appears that this flag is now causing the issue within this thread, where the registered click positions of elements are shifted, so that the area Cypress calculates to click at, is not the coordinate that Chrome is listening at due to a bug. I have not tracked down the bug in Chromium yet because their bugs list is insanely long.
Hopefully removing this flag does not cause the AUT to shake again. I am not seeing this behavior anyway.
The Workaround Today
Within your cypress/plugins/index.js
file, we will want to remove the --disable-blink-features=RootLayerScrolling
flag from the flag arguments being sent to chrome before launch.
module.exports = (on) => {
on('before:browser:launch', (browser = {}, args) => {
if (browser.name === 'chrome') {
args = args.filter((arg) => {
return arg !== '--disable-blink-features=RootLayerScrolling'
})
return args
}
})
}
Cypress Fix
We will remove this flag in our next release of Cypress after tracking down the exact Chromium issues and ensuring the AUT shaking bug does not return.
We are going to remove --disable-blink-features=RootLayerScrolling
for Chrome versions 68 or higher
The AUT shaking was primarily affecting versions 66 and 67, so it seems safe to remove although it is still an open bug on Chromium's bug tracker
Can confirm, had the same issue. @jennifer-shehane your work around helped
I was getting this error this morning, whereas it was working perfectly yesterday (and I made no changes). I'm using the local version of Cypress on OSX, and when my computer woke up this morning there was an error message about not being able to contact the server or something.
Closing Cypress.app and restarting it solved the problem.
I'm still having this problem, what is the proposed fix? Do i need to C/P those LOCs above? Just upgraded to 3.1 in attempt to have this solved to no avail
@egucciar Ensure that you remove the following code below from your plugins/index.js
file (as you may have added this as a workaround previously for https://github.com/cypress-io/cypress/issues/1620)
module.exports = (on) => {
on('before:browser:launch', (browser = {}, args) => {
if (browser.name === 'chrome') {
args.push('--disable-blink-features=RootLayerScrolling')
return args
}
})
}
Hello there, I'm having the same problem.
Chrome: 68.0.3440.106 Cypress: 5.0.3
@jennifer-shehane Still getting this error and https://github.com/cypress-io/cypress/issues/2037#issuecomment-407898194 doesn't help either. Should I open an issue?
Ran into the exact same issue. Upgrading to 3.1.0 fixed the issue for me. Thank you!
I'm using Chrome 68.0.3440.106 on macOS 10.13.6
@LeKoArts What version of Cypress are you using?
@jennifer-shehane I'm using cypress@^3.1.0
and the only way my tests are passing right now is by using .click({ force: true })
which is a real bummer.
@LeKoArts Could you include some of the errors you are getting / screenshots? Also include what version of Chrome you are using to test?
@jennifer-shehane I'm using Chrome 68 if you meant that:
As you see the element is clearly visible
@LeKoArts This is an issue related to Cypress calculations used for visibility - where it thinks the element has height/width of 0 at the time of clicking. We need to improve our calculations on this.
Have you tried using .click({force: true})
? This will bypass our visibility check.
See this issue: https://github.com/cypress-io/cypress/issues/2000
This is unrelated to the bug in this issue - which was effectively shifting the coordinates of every DOM element in the application.
@jennifer-shehane .click({force: true})
is solving this issue, yes. But for me it's a big bummer to bypass all this checks which are quite nice.
I don’t want to use force everywhere :(
I am still facing this issue,
.click({force: true})
it doesn't work for me, i am using chrome 69.0.3497.81
any updates ?
Cypress 3.1.0 Chrome 69.0.3497.100
Attaching a screenshot with my failure (though assert for "Unverified" label works fine)
cy.contains(mail_address).should('be.visible')
cy.contains('Unverified').should('be.visible')
UPD: today I'm getting the following for "Unverified" label
This element '<title>' is not visible because its content is being clipped by one of its parent elements, which has a CSS property of overflow: 'hidden', 'scroll' or 'auto'
Any updates, still seeing this?
This was a very bizarre issue concerning some Chrome flags in versions over 67 that inadvertently shifted the DOM so that it would cover elements. I am locking this conversation due to many comments about other visibility issues with assumptions that it is related to this use case.
We are aware of many other visibility issues and suggest you search the other issues tagged as such or open a new issue giving a reproducible example. Existing Visibility Issues
Current behavior:
In 2.1.0 tests work fine. In 3.0(1) cypress test fails because cypress think that elements covered, but that just dont make any sense. For example:
Or like this
Desired behavior:
No errors with hovered elements like in 2.1
Versions
Windows 10, Chrome 68