I am working on a PHP based Website written in the symfony framework. I want to do automated GUI testing. All I know about testing is PHPUnit tests which won't apply for my GUI application. Is there a particular testing framework excepts Selenium 1 or 2. I'm looking for a kind of a easy-to-understand-framework which ist able to do the testings repeatedly. Are there any good out there which fit good to my php symfony website? Which ones are easy to use (I need to do testing but I don't have a lot of time for that, however, I don't want to ignore that). The website is not to complex. but it has different subsites for different user-roles with different permissions. So is there a simple framework that will let me test my application fast and in a strong way to find bugs and create a test report?
-
2https://codeception.com/ will take care of it! ;-) (also has symfony modules) – delboy1978uk Oct 22 '18 at 14:35
-
Take a look at Panther : https://symfony.com/blog/introducing-symfony-panther-a-browser-testing-and-web-scrapping-library-for-php – COil Oct 22 '18 at 14:37
-
I don't trust panther COil. First up, he can't even spell "scraping" in the title. Secondly, using a proper acceptance testing suite is better than using a scraping lib. – delboy1978uk Oct 22 '18 at 14:39
-
1trust me you will love it! `$I->amOnPage('/news'); $I->see('Latest News'); $I->click('#some-link'); $I->see('something else!')` It rocks! – delboy1978uk Oct 22 '18 at 14:53
1 Answers
There is a well-established functional testing library built into Symfony (or easily included in Symfony 4+/Flex) which is very usable from a PHPUnit perspective. It's also quite fast, as it builds a running Symfony app within itself rather than using an external system and webserver. With it, you can navigate around a site, enter data for forms, and check things happen as planned. I was actually using it today to ensure that only appropriate people had permission to login, and could see the expected information. All of which is run from a PHPunit integration test.
It can't run however run Javascript, and so for that, the same people that created the WebTestCase have added a drop-in-replacement/extension called Panther, for where more involved tests are required. It uses an API to Chrome and Firefox, called the WebDriver protocol to control a real browser from code. While it will be a little slower, the protocol and controlling system allows full use and testing of Javascript.
Best of all, it's just another interface with the same code you would write with the regular WebTest code, and so it's also easy to use as well (although setting it up will be a little 'interesting', as it is so new).
There has also been a comment above:
First up, he can't even spell "scraping" in the title.
Bear in mind the writer of the announcement post, and of the Panther library, is Kévin Dunglas, English is his second (possibly third) language, not counting computer code - so criticising a simple spelling error is very petty. It also has nothing to do with the quality of the code - which is excellent. Other code he's been involved (or leads the team) in includes the API Platform - and the Symfony core team.

- 34,482
- 9
- 71
- 110