Skip to content
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

BUGFIX SpeedUp Inspector Title E2E Test #3688

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

mhsdesign
Copy link
Member

Previously do to some automatic magic tescafe would wait before clicking into the iframe because the unappliedChangesOverlay is already in the dom and this warning is shown:

TestCafe cannot interact with the <iframe name="neos-content-main"> element because another element obstructs it.
When something overlaps the action target, TestCafe performs the action with the topmost element at the original target's location.
The following element with a greater z-order replaced the original action target: <div class="unappliedChangesOverlay">.
Review your code to prevent this behavior.

This waiting results in a super slow down of multiple seconds! To fix this we dont attempt to click directly in the iframe via selector but we use click left to the inspector (via negative offset) that allows to trick tescafe.

Alternative options are possibly to use a ClientFunction, absolute coordinate clicking (doesnt seem possible with testcafe) or adding a timeout Selector('iframe', {timeout: 200}) to the selector, which would still cause the warning to dispatch though.

What I did

How I did it

How to verify it

Previously do to some automatic magic tescafe would wait before clicking into the iframe because the unappliedChangesOverlay is already in the dom and this warning is shown:

> TestCafe cannot interact with the <iframe name="neos-content-main"> element because another element obstructs it.
  When something overlaps the action target, TestCafe performs the action with the topmost element at the original target's location.
  The following element with a greater z-order replaced the original action target: <div class="unappliedChangesOverlay">.
  Review your code to prevent this behavior.

This waiting results in a super slow down of multiple seconds!
To fix this we dont attempt to click directly in the iframe via selector but we use click left to the inspector (via negative offset) that allows to trick tescafe.

Alternative options are possibly to use a ClientFunction, absolute coordinate clicking (doesnt seem possible with testcafe) or adding a timeout `Selector('iframe', {timeout: 200})` to the selector, which would still cause the warning to dispatch though.
Copy link
Contributor

@grebaldi grebaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mhsdesign,

makes total sense. I wouldn't even call that a hack, since the whole purpose of the unapplied changes overlay is to obstruct the <iframe/>, which is duely recognized by test café :)

I read your change as "click somewhere in the general area where the guest frame should be, expect it to be obstructed and to trigger the unapplied changes dialog".

So, overall this LGTM 👍

Copy link
Member

@markusguenther markusguenther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can verify that it works, and it is much faster for the test cases.

.click(Selector('#neos-UnappliedChangesDialog-apply'))
.expect(InspectorTitleProperty.value)
.eql('Home-1-3')
.click(Selector('[name="neos-content-main"]'))
.click(Selector('#neos-Inspector'), {offsetX: -400}) // hack to click into the iframe even with overlaying changes div in dom
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a worst-case screen size, it can happen that you click the left sidebar instead of the content canvas.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes and that still would trigger the overlay ^^ also the tests are run in a fixed window sized :D

@mhsdesign mhsdesign merged commit f50439f into 7.3 Jan 15, 2024
9 checks passed
@mhsdesign mhsdesign deleted the bugfix/speedUpInspectorTitleE2ETest branch January 15, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants