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

.click() fails to scroll checkboxes into view for a long form (scrolls to top instead) (Chrome) #8165

Open
henrik-jmh opened this issue Mar 29, 2024 · 8 comments
Assignees
Labels
HAS WORKAROUND SYSTEM: native automation TYPE: bug The described behavior is considered as wrong (bug).

Comments

@henrik-jmh
Copy link

What is your Scenario?

We have a long form. We want to check checkboxes on the form. The form is in an iframe.
It fails in Chrome (123) but works in Firefox (123).

What is the Current behavior?

When the test tries to click on a checkbox, it scrolls the page to the top of the form, and then fails to check the checkbox.

What is the Expected behavior?

t.click() should select a checkbox even if it is at first out of scroll view.

What is the public URL of the test page? (attach your complete example)

https://www.johnmuirhealth.com/secure/community-support-request.html
You can view the form, but please don't submit.

What is your TestCafe test code?

await t.navigateTo('https://www.johnmuirhealth.com/secure/community-support-request.html');
await t.switchToIframe('#aemFormFrame');
await t.click('input[aria-label="None of the above"]');
await t.debug();

Your complete configuration file

{
"screenshotPath": "./screenshots",
"takeScreenshotsOnFails": true,
"screenshotPathPattern": "${DATE}_${TIME}/${FIXTURE}.png",
"hostnameWeb": "www.johnmuirhealth.com",
"selectorTimeout": 50000
}

Your complete test report

$ npx testcafe chrome ./tests/jmhForms.test.js --test test1 -e
Running tests in:

  • Chrome 123.0.0.0 / Windows 11

JMH Forms Tests
Stopping TestCafe...

Screenshots

No response

Steps to Reproduce

  1. Run the code in this report against the URL specified in this report.
  2. Note that the checkboxes that are outside of view don't get checked.

TestCafe version

3.5.0

Node.js version

v16.19.1

Command-line arguments

npx testcafe chrome test.js --test test1 -e

Browser name(s) and version(s)

Chrome 123

Platform(s) and version(s)

Windows 11, Windows 10

Other

Note that if you quickly zoom out (e.g., using ctrl+scrollwheel), it works because then there is no need to scroll.
So it seems to us, click() and hover() has an issue with checkboxes in an iframe in a long form in Chrome.

@henrik-jmh henrik-jmh added the TYPE: bug The described behavior is considered as wrong (bug). label Mar 29, 2024
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 29, 2024
@Bayheck Bayheck added STATE: Issue accepted An issue has been reproduced. and removed STATE: Need response An issue that requires a response or attention from the team. labels Apr 1, 2024
Copy link

github-actions bot commented Apr 1, 2024

We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.

@Bayheck
Copy link
Collaborator

Bayheck commented Apr 15, 2024

Hello, I managed to reproduce the issue.

As a workaround, try using t.dispatchEvent(target, 'click') and let us know if it worked for you.

https://testcafe.io/documentation/403091/reference/test-api/testcontroller/dispatchevent

@Bayheck Bayheck added the STATE: Need clarification An issue lacks information for further research. label Apr 15, 2024
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 15, 2024
@Bayheck Bayheck added HAS WORKAROUND and removed STATE: Need response An issue that requires a response or attention from the team. labels Apr 15, 2024
@henrik-jmh
Copy link
Author

Yes, the workaround does work. Thanks!

@github-actions github-actions bot removed the STATE: Need clarification An issue lacks information for further research. label Apr 15, 2024
@darkowic
Copy link

@Aleksey28 do you plan to implement the fix in the library? I see the workaround but would be great if it works OOTB when t.click is used.

It used to be working without native automation, as described in #8166.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 16, 2024
@Aleksey28
Copy link
Collaborator

Hi @darkowic,

Due to the workaround that exists, the priority of this issue is relatively low. That means that we don’t have immediate plans to work on this task, and I closed it for a while.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 22, 2024
@darkowic
Copy link

It's breaking user experience as it requires additional knowledge and usage of not "standard" API. Obviously, the workaround should be documented on the page but I don't see this will happen. Also, as I mentioned above, it use to be working before v3.

At least keep the issue open to not forget about this... Closed issue will be forgotten forever.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 22, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented Apr 25, 2024

Hello, we are working on this issue.
I will reopen it.

@Bayheck Bayheck reopened this Apr 25, 2024
@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 25, 2024
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 25, 2024
@Aleksey28 Aleksey28 removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 26, 2024
@aleks-pro aleks-pro added SYSTEM: native automation and removed STATE: Issue accepted An issue has been reproduced. labels Apr 29, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented Apr 29, 2024

Hello, we researched the issue further and found that the root cause is quite complex to fix at the moment.

We will get back to this issue if we give it a higher priority in the future.

For now, the solution is to use the workaround.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 29, 2024
@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HAS WORKAROUND SYSTEM: native automation TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

5 participants