Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix: #29093 for elements with length in rem #29224
fix: #29093 for elements with length in rem #29224
Changes from all commits
8b1182f
da6825f
f4278d0
7d08741
cc86762
cf5353a
c2e4f99
bd82c5d
b5c97d7
bbeb1bb
6d48369
71cdb93
f85f307
b15254c
0e52c90
55ac75f
8ef291b
47d2948
9d84c25
2a4d554
347ca9e
5d57f92
4ad8136
f484c50
7912583
0fcc3ea
537176c
d13e552
044d3ec
2d85cb3
2842d5e
1d7d9ab
023646b
8dc2777
92629ad
89dedb4
61749d7
03f07cb
ec3f9ab
1d9a335
5c57aed
5ac6fe5
f8d4b3e
ad39a62
8371a99
82a4058
bc2f850
2a423cb
9f288ad
4612dc1
606ca75
7aac0f9
be84785
aa659ee
050ff5f
35022fc
f3b4081
c13d19c
fc85dd5
d423dfc
6073f20
8e49f91
07b50b5
0ada697
85dbb8a
f94e28e
a1133a2
47dfcf2
a5ad454
b281e84
461e6e7
46f5105
c670a8e
03bc284
0d0d984
e791a7b
eb598ee
52be351
7082a6b
04efcf5
5a279d8
95c624c
093c8e0
98c56de
09fe08f
53c7242
3862c48
bf76534
bcea9bd
cad469d
58f2e9d
7cf025a
d6ad12d
9561099
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what is causing Cypress to not properly determine that
#sidebar-left
is not hidden in the fixture.display: contents
causes the element to not generate its own box, which prevents overflow:hidden from being applied as expected - the element is effectively replaced by its children, and its box model (and overflow settings) should be disregarded. See: https://drafts.csswg.org/css-display/#valdef-display-contents.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true. Check moved to canClip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relative elements can be clipped by absolute ancestors that have
height
orwidth
of0
andoverflow:hidden
.canClipContent
(L#230) checks for various edge cases with offset parents before comparing the dimensions of an element and their ancestor to determine if the element is actually obscured by clipping.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to canClipContent. This is just first working fix. Assumption is: when El has position relative and it's ancestor Absolute than this can not be clipped. But if this assumption is not exactly correct then more complicated check could be done. It's just better then existing version for this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@senpl Could you explain the need for this change? If users are required to update their tests based on this change, this would be considered a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.shiki is not precise selector. In moment of search in this test there are two elements with this locator. One berly visible but still possible to locate.
This selector better explain what test intended to search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be breaking change for poorly created locators. Still it's closer to what user can actually see in browser. So it's probably good change. If I could locate element in browser then it's visible, but there should be some rules to determine if something is visible or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @senpl ,
There are two
.shiki
elements in this component. One of them is always hidden, and one of them that should show/hide on click. The hidden state for this element is caused by a parent element with maxHeight of 0, and overflow:hidden.I do agree that the
.shiki
selector here should be more specific. I edited it to assert the expected visibility state of both elements:Unfortunately, while this test passes on the
develop
, it does not pass with the visibility changes in this branch. Can you look into why?Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already did.
But this second locator is still visible. I could click it in browser and get it's locator. It's not big. It could to be very hard to click on it. Still it is visible. I do not see reason for Cypress to mark something as invisible when it is visible. It might produce warning that something is hardly visible, still if it's partly visible it should not expect that element to be not visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in pictures below .shrik width is bigger then element code below in moment of checking. This is why something that is really invisible or not exist should be checked, not something that is visible in moment of click. Alternatively we could wait for this moment to become invisible, but this would make test slower and not as practical.