giorgiosironi / phpunit-selenium

Selenium RC integration for PHPUnit
http://www.phpunit.de/
Other
602 stars 271 forks source link

Port 2.x changes to master #399

Closed paulbriton closed 7 years ago

paulbriton commented 7 years ago

As discussed with @giorgiosironi, here is the changes from 2.x that I've made. I've just "cherry-picked" the commits that also concern this line.

paulbriton commented 7 years ago

Vagrant build is ok but travis one isn't fixed yet.

It might be linked to the PHPUnit version, maybe someone has a better clue with the stack trace:

PHP Fatal error:  Class 'PHP_CodeCoverage' not found in /home/travis/build/giorgiosironi/phpunit-selenium/Tests/Selenium2TestCase/Coverage/CookieTest.php on line 14

PHP Stack trace:
PHP   1. {main}() /home/travis/build/giorgiosironi/phpunit-selenium/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /home/travis/build/giorgiosironi/phpunit-selenium/vendor/phpunit/phpunit/phpunit:52
PHP   3. PHPUnit_TextUI_Command->run() /home/travis/build/giorgiosironi/phpunit-selenium/vendor/phpunit/phpunit/src/TextUI/Command.php:118
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /home/travis/build/giorgiosironi/phpunit-selenium/vendor/phpunit/phpunit/src/TextUI/Command.php:188
PHP   5. PHPUnit_Framework_TestSuite->run() /home/travis/build/giorgiosironi/phpunit-selenium/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:487
PHP   6. PHPUnit_Framework_TestSuite->run() /home/travis/build/giorgiosironi/phpunit-selenium/vendor/phpunit/phpunit/src/Framework/TestSuite.php:728
PHP   7. Tests_Selenium2TestCase_Coverage_CookieTest->run() /home/travis/build/giorgiosironi/phpunit-selenium/vendor/phpunit/phpunit/src/Framework/TestSuite.php:728

I'll look further later in the week, but travis build is such a pain to debug.

paulbriton commented 7 years ago

OK I think I've found the issue. The class PHP_CodeCoverage has been renamed in latest PHPUnit release. See php-code-coverage.

So we have two choices, either update the class name (and the eventually add the dependency) in order to add the coverage option or we mark this test as incomplete (which is the easiest solution).

What do you think @giorgiosironi ?

giorgiosironi commented 7 years ago

If i's a dependency on a 5.x (5.6? 5.7?) PHPUnit, I'd say go ahead and add it in the composer.json. This will impact new releases of PHPUnit_Selenium, and upgrading to a new minor version of PHPUnit should be a non-event anyway.

paulbriton commented 7 years ago

It was easier than I thought. The dependency is included in PHPUnit, I just had to update class names, PHPUnit version and correct a buggy test.

And here is travis build green again !

giorgiosironi commented 7 years ago

This build multiple times correctly, and I have added you to the contributors in composer.json. Only failure I saw was: https://travis-ci.org/giorgiosironi/phpunit-selenium/jobs/194638642 which may be something non-deterministic like a missing wait condition.

paulbriton commented 7 years ago

Yes this test might fail sometimes, I'll add a wait condition on the selector in the Tests_WelcomePage constructor.

paulbriton commented 7 years ago

Thank's for adding me to the contributor list by the way ;)