开发者

How Does One Produce a Selenium Test with Database Fixture

开发者 https://www.devze.com 2023-01-23 23:07 出处:网络
Zend Test appears to rely upon Zend_Test_PHPUnit_DatabaseTestCase and Selenium appears to need PHPUnit_Extensions_SeleniumTestCase yet as far as I can tell PHP doesn开发者_StackOverflow\'t support mul

Zend Test appears to rely upon Zend_Test_PHPUnit_DatabaseTestCase and Selenium appears to need PHPUnit_Extensions_SeleniumTestCase yet as far as I can tell PHP doesn开发者_StackOverflow't support multiple inheritance.


You do not have to extend the PHPUnit_Extensions_SeleniumTestCase, you can initialize Selenium in your setUp method and close it in tearDown:

class GoogleTest extends Zend_Test_PHPUnit_DatabaseTestCase {

    private $selenium;

    public function setUp()
    {
        $this->selenium = new Testing_Selenium("*iexplore", "http://<your_url_under_the_test>");
        $this->selenium->start();
    }

    public function tearDown()
    {
        $this->selenium->stop();
    }

    // Your tests...

}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号