Comments (5)
Hello,
We have created a Pull Request with a fix.
from testcafe.
Hello,
The issue is similar to this one: #8148 (comment).
Basically, the click method clicks the center of your Selector by default.
In the case of a two-word link, you need to add an offset option to your click call.
For your specific example, the following option worked:
.click('.info a', { offsetX: 5 })
https://testcafe.io/documentation/402710/reference/test-api/testcontroller/click#options
Let us know if this helps.
from testcafe.
Thanks for the reply @Bayheck.
No, that does not fix the issue, as a 5px horizontal offset from the top left corner of the bounding box is still not on the link itself, as you can see from this screenshot:
This seems like a fairly fundamental regression in behaviour -- if I'm telling TestCafé to click on a link, it should be able to do so without me having to provide case-by-case special handling. It worked before version 3 without any issue.
Obviously we can change our client side code to make the issue go away, but I really think this is a bug you should address.
from testcafe.
Hello, in v3.0 and newer, TestCafe runs tests with the Native Automation option enabled by default.
The update from v2 to v3 is major and it may lead to breaking changes.
Please use the offset option of your choice to adjust the click.
If Native Automation does not meet your needs, you can always disable it and run your tests:
--disable-native-automation
from testcafe.
It seems extraordinary to me that simply using TestController.click
on a link might fail in TestCafé when using native automation without special handling.
Bear in mind also that testing UI like this on different devices or resolutions might require different offsets as the text will wrap differently.
If you're unwilling to look at fixing this in your code, then you will need to update your documentation for this method to explain that it isn't reliable for text-based links that break across lines.
Other people will have the same problem in the future.
from testcafe.
Related Issues (20)
- Headless Chrome workaround fails with Chrome 123.0.0.0 HOT 3
- t.scrollBy and t.scroll methods not working properly on virtual scrollers HOT 3
- Unable to proceed to next step after upload file when using setFilesToUpload function HOT 8
- execution stucks! HOT 5
- please add pathPattern to takeElementScreenshot too HOT 1
- Testcafe became very unstable a few weeks ago HOT 2
- Application landing on blank page / not loading property HOT 7
- Checking if an element exists resolves immediately without waiting for timeout HOT 3
- Error: connect ECONNREFUSED 127.0.0.1:34261 - trying to run tests in Docker HOT 1
- Is there a way to handle a Chrome popup for allowing shared clipboard? HOT 1
- Is there a way to handle a Chrome popup to allow for a shared clipboard? HOT 1
- Testcafe 3.6.0 not compatible with Node 14 HOT 1
- Basic HTTP auth doesn't work with Chrome native automation HOT 9
- Inspected target navigated or closed HOT 9
- Not possible to type text in PrimeReact number input HOT 7
- userVariables are not available in global hooks HOT 3
- Use esbuild instead of babel HOT 1
- File upload problem with Excel Files in Latest Version of Chrome 125 HOT 19
- Provide option to turn off chrome headless=new feature HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testcafe.