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 "key" and "keyIdentifier" properties in key events while typing or pressing a key combination #1079

Closed
georgiy-abbasov opened this issue Dec 19, 2016 · 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

@georgiy-abbasov
Copy link
Contributor

Are you requesting a feature or reporting a bug?

bug

What is the current behavior?

TestCafe provides keyIdentfier and key properties only when pressing 'Enter' key, for many others keys it doesn't provided.

What is the expected behavior?

These properties should be provided for all symbols and with the next rule:
In Chrome with version < 54 and Safari key events provide only keyIdentifier
In Chrome with version >= 54 and other browsers key events provide only key

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

Run test

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

Tested page URL:
Page markup:

<body>
<script>
    window.keyupSequence = '';
    window.keydownSequence = '';
    window.keypressSequence = '';

    window.addEventListener('keyup', function (e) {
        window.keyupSequence += e.key;
    });

    window.addEventListener('keydown', function (e) {
        window.keydownSequence += e.key;
    });

    window.addEventListener('keypress', function (e) {
        window.keypressSequence += e.key;
    });
</script>
</body>

Test code

test('shift+a', async t => {
  const getKeySequences = ClientFunction(() => { 
    return { keyup: window.keyupSequence, keydown: window.keydownSequence, keypress: window.keypressSequence };
  });
  
  await t.pressKey('shift+a');

	const sequences = await getKeySequences();

  await t.expect(sequences.keydown).eql('ShiftA')
  await t.expect(sequences.keypress).eql('A')
  await t.expect(sequences.keyup).eql('AShift')
});

Specify your

  • operating system: WIN10x64
  • testcafe version: 0.12.0-alpha
  • node.js version: v6.9.1
@georgiy-abbasov georgiy-abbasov added AREA: client SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug). labels Dec 19, 2016
@georgiy-abbasov georgiy-abbasov self-assigned this Dec 19, 2016
@georgiy-abbasov
Copy link
Contributor Author

Working on it

@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #3 milestone Dec 19, 2016
georgiy-abbasov pushed a commit to georgiy-abbasov/testcafe-phoenix that referenced this issue Dec 20, 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
…loses DevExpress#1079) (DevExpress#1070)

* Fixed wrong "key" and "keyIdentifier" properties in keyEvent objects (closes DevExpress#1079)

* Remarks fixed

* Comment fixed
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

2 participants