Giter VIP home page Giter VIP logo

Comments (5)

Bayheck avatar Bayheck commented on June 10, 2024 1

Hello,
We have created a Pull Request with a fix.

#8183

from testcafe.

Bayheck avatar Bayheck commented on June 10, 2024

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.

mikejamesthompson avatar mikejamesthompson commented on June 10, 2024

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:

Screenshot 2024-04-26 at 15 33 09 (2)

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.

Bayheck avatar Bayheck commented on June 10, 2024

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.

mikejamesthompson avatar mikejamesthompson commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.