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

t.typeText() not working with React's new version (15.6.1) #1558

Closed
m4n3z40 opened this issue Jun 21, 2017 · 6 comments
Closed

t.typeText() not working with React's new version (15.6.1) #1558

m4n3z40 opened this issue Jun 21, 2017 · 6 comments
Assignees
Labels
AREA: client !IMPORTANT! 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

@m4n3z40
Copy link

m4n3z40 commented Jun 21, 2017

Are you requesting a feature or reporting a bug?

It can be a bug or a feature request, depends on the way you look at it 😛

What is the current behavior?

For some reason t.typeText() is not triggering the onChange handler within a text input element.

What is the expected behavior?

t.typeText() should trigger onChange event when typing each character so we can react on it.

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

  1. Create an application with React latest version (15.6.1)
  2. Create a component with a text input element and setup any handler for the onChange prop
  3. Add a console.log() in the handler
  4. Create a test that types into that text input
  5. Run the tests and assert that no logs were emitted

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

Test code

Component:

class LoginForm extends PureComponent {
  constructor(props) {
    super(props);

    this.state = {
      email: ''
    };

    this.handleEmailChange = this.handleEmailChange.bind(this);
  }

  handleEmailChange({ target }) {
    console.log(target.value);
    
    this.setState({ email: target.value });
  }

  render() {
    return (
      <input
        id="loginField"
        type="text"
        value={this.state.value}
        onChange={this.handleEmailChange}
      />
    );
  }
}

Test

test('Should be able to type into login input', async (t) => {
  await t
    // Will show as if it's working, but nothing will be logged in the console
    .typeText(loginField, 'This will not be logged')
    // Although this will pass
    .expect(loginField.value, 'This will not be logged');

    // So you can can open console and see output
  await t.wait(1000000);
});

Specify your

  • operating system: Ubuntu 16.04 LTS
  • testcafe version: 0.16.1
  • node.js version: 6.11.0
@AlexanderMoskovkin AlexanderMoskovkin added AREA: client SYSTEM: automations TYPE: bug The described behavior is considered as wrong (bug). labels Jun 22, 2017
@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #8 milestone Jun 22, 2017
@AlexanderMoskovkin
Copy link
Contributor

Hi @m4n3z40,

We've reproduced the issue and will investigate it.

@helen-dikareva
Copy link
Collaborator

helen-dikareva commented Jun 22, 2017

Thank you for your assistance. We have found a problem that persists since version 15.6.0 of the react-dom package. We will fix it ASAP.

@mnemanja
Copy link

I can confirm that with the version 0.16.2 this works fine.

@m4n3z40
Copy link
Author

m4n3z40 commented Jun 27, 2017

Awesome. Thanks Team.
Really good work.

@AlexanderMoskovkin
Copy link
Contributor

Thanks! =)

AlexanderMoskovkin pushed a commit to AndreyBelym/testcafe that referenced this issue Jul 20, 2017
DevExpress#1558) (DevExpress#1567)

* fix `t.typeText() not working with React's new version (15.6.1)` (close DevExpress#1558)

* fix review's issue

* fix test in ie11
@lock
Copy link

lock bot commented Mar 28, 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 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
DevExpress#1558) (DevExpress#1567)

* fix `t.typeText() not working with React's new version (15.6.1)` (close DevExpress#1558)

* fix review's issue

* fix test in ie11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client !IMPORTANT! 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

5 participants