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

Don't scroll to parent element while focusing on non-focusable element during click automation #913

Closed
georgiy-abbasov opened this issue Oct 24, 2016 · 1 comment
Assignees
Labels
AREA: client STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@georgiy-abbasov
Copy link
Contributor

Are you requesting a feature or reporting a bug?

bug

What is the current behavior?

If click automation is performing on element, which isn't focusable but it parent does, it scrolls to the parent element

What is the expected behavior?

It must not scroll to focusable parent element, cause it isn't happening when we performs click natively (without TestCafe).

How would you reproduce the current behavior (if this is a bug)?

Run the test

Provide the test code and the tested page URL (if applicable)

Tested page URL:
HTML markup:

<!DOCTYPE html>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div id="parent" style="width:500px; height:2000px; top:500px; position:absolute; background:grey;" tabindex="0">
    <div id="child" style="width:200px; height:200px; top:200px; position:absolute; background:red;"></div>
</div>
</body>
</html>

Test code

import { expect } from 'chai';
import { ClientFunction } from 'testcafe';

fixture `bug`
    .page `index.html`;

const getWindowTopScroll = ClientFunction(() => window.pageYOffset);

test("Shouldn't scroll to the parent", async t => {
    const oldWindowScrollValue = await getWindowTopScroll();

    await t.click('#child');

    const newWindowScrollValue = await getWindowTopScroll();

    expect(newWindowScrollValue).eql(oldWindowScrollValue);
});

Specify your

  • operating system: WIN 10 x64
  • testcafe version: 0.10.0-alpha
  • node.js version: v5.7.0
@georgiy-abbasov georgiy-abbasov added TYPE: bug The described behavior is considered as wrong (bug). AREA: client SYSTEM: automations labels Oct 24, 2016
@georgiy-abbasov georgiy-abbasov added this to the Sprint #1 milestone Oct 24, 2016
@georgiy-abbasov georgiy-abbasov self-assigned this Oct 24, 2016
georgiy-abbasov pushed a commit to georgiy-abbasov/testcafe-phoenix that referenced this issue Oct 24, 2016
georgiy-abbasov pushed a commit to georgiy-abbasov/testcafe-phoenix that referenced this issue Oct 26, 2016
@lock
Copy link

lock bot commented Mar 29, 2019

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.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 29, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

1 participant