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

Hammerhead internal event listener is called twice #2062

Closed
Dmitry-Ostashev opened this issue Jul 2, 2019 · 1 comment
Closed

Hammerhead internal event listener is called twice #2062

Dmitry-Ostashev opened this issue Jul 2, 2019 · 1 comment
Assignees
Labels
!IMPORTANT! STATE: Auto-locked Issues that were automatically locked by the Lock bot support center These issues based on ones from Support Center SYSTEM: iframe processing TYPE: bug
Milestone

Comments

@Dmitry-Ostashev
Copy link
Collaborator

Dmitry-Ostashev commented Jul 2, 2019

What is your Test Scenario?

Record a test with the TestCafe Studio. See https://github.com/DevExpress/testcafe-studio/issues/2541

What is the Current behavior?

Internal event listener may be called twice

What is the Expected behavior?

It should be called once

What is your web application and your TestCafe test code?

Your website URL (or attach your complete example):

Your complete test code (or attach your test files):
fixture `test`
    .page `about:blank`;

test('test', async t => {
    await t.eval(() => {        
        window.counter = 0;
        window['%hammerhead%'].eventSandbox.listeners.addInternalEventListener(window, ["keypress"], () => { 
            window.counter++;
        });
        var ev = new Event('keypress');
        ev.key = 'a';
        window.dispatchEvent(ev);
    });
    await t.wait(1000);
    console.log(await t.eval(() => window.counter));    
});

Steps to Reproduce:

Another way to determine this issue:

  1. Set a huge t.wait() timeout in the test above
  2. Run test, open chrome DevTools
  3. Check the event handlers via console: getEventListeners(window).keypress
  4. There will be two same handlers

Your Environment details:

  • testcafe version: 1.2.1
  • node.js version: 10.15.1
  • command-line arguments: testcafe chrome test.js
  • browser name and version: Chrome 75, Opera 62
  • platform and version: Windows 10, Linux Ubuntu 18.04
@AndreyBelym AndreyBelym transferred this issue from DevExpress/testcafe Jul 2, 2019
@AndreyBelym AndreyBelym added support center These issues based on ones from Support Center TYPE: bug and removed STATE: Need response labels Jul 2, 2019
@LavrovArtem LavrovArtem added this to the Sprint #37 milestone Jul 17, 2019
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Jul 22, 2019
@LavrovArtem LavrovArtem self-assigned this Jul 22, 2019
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Aug 1, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #37, Sprint #38 Aug 5, 2019
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Aug 5, 2019
@lock
Copy link

lock bot commented Aug 15, 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 Issues that were automatically locked by the Lock bot label Aug 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
!IMPORTANT! STATE: Auto-locked Issues that were automatically locked by the Lock bot support center These issues based on ones from Support Center SYSTEM: iframe processing TYPE: bug
Projects
None yet
Development

No branches or pull requests

3 participants