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

Wrong events is sequence simulated during test execution #3098

Closed
helen-dikareva opened this issue Nov 9, 2018 · 2 comments
Closed

Wrong events is sequence simulated during test execution #3098

helen-dikareva opened this issue Nov 9, 2018 · 2 comments
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

@helen-dikareva
Copy link
Collaborator

Reproducing:

  1. page
<input type="text" id="test" onchange="doTest()"/>
<input id="anotherInput"/>

<script>
    function handler (e) {
        console.log('____________________________________');
        console.log(e.type);
        console.log(e.target);
        console.log(document.activeElement);
        console.log('____________________________________');
    }

    const checkedEvents = ['mousedown', 'mouseup', 'click', 'blur', 'focus', 'change'];

    for(const event of checkedEvents)
        document.addEventListener(event, handler, true);


    function doTest () {
        const input = document.getElementById('test');

        if (input.value === 'aaa') {
               input.focus();
               input.setSelectionRange(0, 3);
        }
    }
</script>
  1. test
fixture `fix`
    .page `http://localhost/testcafe`;

test('test', async t => {
    await t
        .typeText('#test', 'aaa')
        .click('#anotherInput')
        .debug(); //check events sequence in console (focus in `doTest()` handler doesn't have an effect)
});

After test actions without TestCafe we have input with id === 'test' is document.activeElement and it have selectionStart = 0, selectionEnd = 3. But with TestCafe only selection is correct.

@AlexKamaev
Copy link
Contributor

fixed in DevExpress/testcafe-hammerhead#1858

@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 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

3 participants