1
votes

I'm trying to execute an acceptance test with Codeception and Selenium, but it looks like the fillField() method does not focus the input field. Which is necessary because when the element loses it's focus I need to send an ajax request. I used the code below:

$I->fillField('.js-project.tt-input', $this->project);

Manually triggering the focus with the following code, does not work either:

$I->executeJS('$(".js-project.tt-input").trigger("focus");');

The javascript code that needs to be executed for the ajax request:

$('.js-project.tt-input').blur(function() { ... }).trigger('blur');

Anyone an idea, about why it would do this?

1
The code is triggered on the loss of focus and your test is only triggering the gain of focus. Focus another field to simulate the loss of focus. - Florent B.
@FlorentB. Tried it and it is still not working. - Sefa Yavuz

1 Answers

0
votes

You can use appendField it focuses the elemnt.