Clicking button outside viewport in iframe silently fails in native automation mode #8166
Labels
STATE: Duplicate
An issues has been already reported in the other thread.
TYPE: bug
The described behavior is considered as wrong (bug).
What is your Scenario?
We have application which is embedding another application via iframe - for example shell and micro frontend. Embedded application has button, which is not in the initial viewport and scroll is required to click it. Button has some action - for example changing text of some other element on page. We want to write test that clicks the button and checks whether action was performed.
What is the Current behavior?
Button is clicked as expected only when native automation is disabled. Enabling native automation results in test failing. Moreover, there is no error that button was not found, but any further assertion which checks whether button action was performed fails.
What is the Expected behavior?
Button should be clicked regardless of native automation being enabled or disabled. Docs are clear that this is expected behaviour:
What is the public URL of the test page? (attach your complete example)
Minimal reproduction scenario is available in this repo: https://github.com/krzempekk/testcafe-issue-repro
Reproduction steps above and in README.md file. Other important files:
tests/test.js
- simple test that clicks button and checks whether text on page was changed.public/shell/index.html
- page served onlocalhost:4000
that embeds other page via iframepublic/mfe/index.html
- page served onlocalhost:4001
that is embedded via iframe. It contains button which changes header text when clicked. Button has 1800px top margin, so it is not visible on initial viewport.What is your TestCafe test code?
Test code (
tests/test.js
file in reproduction repo):Your complete configuration file
No configuration file
Your complete test report
When running with native automation disabled (
yarn test:no-native
command in repro repo): test passesWhen running with native automation enabled (
yarn test
):Screenshots
No response
Steps to Reproduce
yarn
to install dependenciesyarn start:shell
andyarn start:mfe
. Simple test pages will be served onlocalhost:4000
andlocalhost:4001
respecitvely.yarn test:no-native
. Test should pass.yarn test
. Test should not pass - this is the issue.TestCafe version
3.5.0
Node.js version
No response
Command-line arguments
testcafe chrome ./tests/test.js
Browser name(s) and version(s)
No response
Platform(s) and version(s)
No response
Other
No response
The text was updated successfully, but these errors were encountered: