I am currently setting up a development environment for my new project and I am thinking hard about one thing. I plan on using Yii. I want to have functional tests automated, I already have gerrit and Jenkins in place, working.
I read this note and found out that selenium has something like html suite. I never heard of it before, I always wrote my tests to be run via PHPUnit. I used default Yii functional tests environment as described here.
So my question is, what are pros and cons of both approaches? I already can think of one pro and con of html suite. Pro is, that writing tests is really easy - you just "click" them in Selenium IDE. The con is, that I probably would have to run db fixtures before testing and I couldn't change them, or run them like - load fixtures, run test, load fixture, run test, but I guess that would be make the tests much sloppier. What do you think/what is your experience in that matter?
there is an easy way to write functional tests. you can downlaod an addon for selenium IDE and then add the php formatter for this addon, and you can make and export functional tests very eeeasy.
then you should configure your protected/config/test.php and protected/tests/bootstrap.php
you should probably edit protected/tests/phpunit.xml and remove any browser, other than fire fox.
then do like Willem Renzema said and change the test made by this addon and change the name of the class to WebTestCase and remove the setUp()
then you are ready to run tests!
cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With