minkphp / Mink

PHP web browser emulator abstraction
https://mink.behat.org/
MIT License
1.6k stars 280 forks source link

Change event tests are slow on Selenium #568

Open aik099 opened 10 years ago

aik099 commented 10 years ago

The recently added change event tests are really slow on MinkSelenium2Driver.

The .invalid selector tests become a bit faster, but slow anyways. Maybe we should introduce some kind of element cache on driver side to make that faster.

stof commented 10 years ago

well, for not found elements, a cache would not help anyway, especially when they are searched only once per page load (we cannot cache accross page changes)

stof commented 10 years ago

and introducing a cache makes it very hard to invalidate it when changing page (and even worse for JS drivers as the DOM can change even without page change)

aik099 commented 10 years ago

All recent tests really made test suite slow, maybe as slow as Sahi test suite one. I kind of don't like it, but I don't see any options to make it better either.

Maybe we can combine missing element search on one page. This way we open page once and try to search for missing elements. Maybe this way Selenium will cache them somehow, but then one failing test will prevent others from even running.

stof commented 10 years ago

given that a passing test involves an exception, it would make the tests ugly as well, and harder to write, by forbidding to use the PHPUnit way to assert exceptions

aik099 commented 10 years ago

What we can do however is to parallelize test run using https://github.com/brianium/paratest and still get single merged coverage file to give to Scrutinizer CI. I did this way in my library and, at least on Travis, it runs super fast.