-
Notifications
You must be signed in to change notification settings - Fork 674
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
Hover action fails for the element that became hidden on mouseover #1679
Comments
Hi @mkubrycz, The
For now there is no API to check whether an element overlapped by another element or not. We have a separated issue for that and discuss possible ways to resolve it: #1186 (comment)
I'll describe how does TestCafe work here. If an action target element is under some other element TestCafe waits for a timeout if it's became visible (it can't be some kind of animation or a big loading panel for example). If the element is not visible after a timeout TestCafe clicks on the point of the page where the element is located. We don't throw an error because of the following reason. For some cases it's ok when the target element is overlapped (for example it can be a floating transparent element that is located under the mouse cursor or it can be some placeholder). The current TestCafe behavior allows to handle these cases. If the target element is overlapped unexpectedly and you try to click on it the next action/assertion should be failed since the click doesn't perform expected behavior. For example, there is a button that shows a popup. In the test you click on the button and check that the popup is shown (or perform some action with the popup). If the button is overlapped the next step after button click will be failed. With all this I've modified a test a it works stable and properly on my side: import { Selector } from 'testcafe';
fixture('hover')
.page('https://jsfiddle.net/s0mnL71L/');
const under = Selector('.under', { timeout: 0 });
const over = Selector('.over');
const frame = Selector('[name="result"]');
let i = 10;
while(i--)
test('succeed to hover', async (t) => {
await t
.expect(frame.visible).eql(true)
.switchToIframe(frame)
.expect(over.visible).eql(false)
.expect(under.visible).eql(true)
.hover(under)
.expect(over.visible).eql(true)
.expect(under.visible).eql(true);
}); |
Thank you @AlexanderMoskovkin for reply. I've updated the fiddle: https://jsfiddle.net/s0mnL71L/1/ please run the same test code on this one |
@mkubrycz , I understand the problem now. It works properly in |
…t became hidden (closes DevExpress#1679)
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
Are you requesting a feature or reporting a bug?
it's a bug
What is the current behavior?
In situation when I have an element with hover effect showing another element on top of it there are two different behaviours:
What is the expected behavior?
this test should pass, and hover action shouldn't check for hovered element visibility after it's already hovered over because something could show up over it. Another thing is that hovered element sometimes is found visible when it's actually not, it shouldn't happen.
How would you reproduce the current behavior (if this is a bug)?
run code below
Provide the test code and the tested page URL (if applicable)
Tested page URL:
Test code
Specify your
The text was updated successfully, but these errors were encountered: