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

Ensure that "change" event is fired only once per "setValue" call #90

Closed
aik099 opened this issue May 8, 2014 · 8 comments
Closed

Ensure that "change" event is fired only once per "setValue" call #90

aik099 opened this issue May 8, 2014 · 8 comments
Labels

Comments

@aik099
Copy link
Member

aik099 commented May 8, 2014

Current results:

  • selectOption for radio: fires 2 times (no manual code, we just call .choose( method, maybe bug in Zombie)
  • check : fires 2 times (no manual code, we just call .check( method, maybe bug in Zombie)
  • uncheck : fires 2 times (no manual code, we just call .uncheck( method, maybe bug in Zombie)

To be on the safe side I've executed these tests on the PhantomJS and they fail the same way as for Selenium2. So it's something in Zombie that causes change to fired twice. Reported in assaf/zombie#675

Tests added in Behat/Mink#495

@aik099 aik099 added the bug label May 8, 2014
@stof
Copy link
Member

stof commented May 8, 2014

why talking about PhantomJS ? It has nothing to do with ZombieDriver. It is a Webdriver implementation

@aik099
Copy link
Member Author

aik099 commented May 8, 2014

Both Zombie and PhantomJS are headless and support JS. I though that for JS support they might be using same libraries. And if a bug, that causes click event to fire 2 onchange events is in that library, then it probably would be broken in both Zombie and PhantomJS.

It turned out that only Zombie does that and PhantomJS does all correctly.

@stof
Copy link
Member

stof commented May 8, 2014

They don't use the same libraries at all. PhantomJS uses webkit (through the QTwebkit project, so an old version of webkit) while Zombie implements a browser in NodeJS (based on JSDom for the DOM implementations).
They are not even written in the same language

@aik099
Copy link
Member Author

aik099 commented Jun 20, 2014

Relevant test suite output:

7) Behat\Mink\Tests\Driver\Js\ChangeEventTest::testSetValueChangeEvent with data set "radio" ('the-radio-m', 'm')
initial value setting triggers change event
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1'
+'2'

.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:150
.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:48

8) Behat\Mink\Tests\Driver\Js\ChangeEventTest::testSelectOptionChangeEvent with data set "radio" ('the-radio-m', 'm')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1'
+'2'

.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:150
.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:84

9) Behat\Mink\Tests\Driver\Js\ChangeEventTest::testCheckChangeEvent with data set #0 (true)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1'
+'2'

.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:150
.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:113

10) Behat\Mink\Tests\Driver\Js\ChangeEventTest::testCheckChangeEvent with data set #1 (false)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1'
+'2'

.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:150
.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:113

11) Behat\Mink\Tests\Driver\Js\ChangeEventTest::testUncheckChangeEvent with data set #0 (true)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1'
+'2'

.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:150
.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:134

12) Behat\Mink\Tests\Driver\Js\ChangeEventTest::testUncheckChangeEvent with data set #1 (false)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1'
+'2'

.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:150
.../vendor/behat/mink/driver-testsuite/tests/Js/ChangeEventTest.php:134

@stof
Copy link
Member

stof commented Aug 30, 2014

Waht we need to fix this is actually a new release of zombie. A fix has been commited months ago (2 weeks after we reported it)

@aik099
Copy link
Member Author

aik099 commented Aug 30, 2014

Wow, I never knew that was a fix at all, can you post a link to fix here?

@stof
Copy link
Member

stof commented Aug 30, 2014

Well, it was not referenced in the issue you reported (which is not closed either). I found it when looking at the history to try to identify what was new since the release

@stof
Copy link
Member

stof commented Sep 25, 2014

The Zombie fix has been released

@stof stof closed this as completed Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants