Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium PHPUnit总是将测试设置为“跳过”_Selenium_Selenium Webdriver_Phpunit - Fatal编程技术网

Selenium PHPUnit总是将测试设置为“跳过”

Selenium PHPUnit总是将测试设置为“跳过”,selenium,selenium-webdriver,phpunit,Selenium,Selenium Webdriver,Phpunit,我在PHPUnit和Selenium扩展方面面临一个奇怪的问题:我通过Composer安装了这两个版本的最新稳定版本。之后,我开始了一个简单的测试类: <?php class TestLogin extends PHPUnit_Extensions_Selenium2TestCase { public function setUp() { $this->setBrowser('firefox'); $this->setBrowserUrl

我在PHPUnit和Selenium扩展方面面临一个奇怪的问题:我通过Composer安装了这两个版本的最新稳定版本。之后,我开始了一个简单的测试类:

<?php
class TestLogin extends PHPUnit_Extensions_Selenium2TestCase {
    public function setUp() {
        $this->setBrowser('firefox');
        $this->setBrowserUrl('http://dev.mydomain.com:10088/');
    }

    public function testHasLoginForm() {
        $this->url('user/login');
        $email = $this->byName('email');
        $password = $this->byName('password');
        $this->assertEquals('', $email->value());
        $this->assertEquals('', $password->value());
    }

    public function testSomething() 
    {
        $this->assertEquals('x', 'y');
    }
}
PHPUnit报告

Starting test 'TestLogin::testHasLoginForm'.
S
Starting test 'TestLogin::testSomething'.
S

有人知道为什么两个测试都被标记为跳过吗?任何帮助都将不胜感激。

我对PHPUnit没有任何经验,但根据我过去使用过的其他测试跑步者,通常,当安装程序或@Before注释的方法抛出异常/错误时,会出现一个跳过错误,该异常/错误可能会中断测试,因此它永远不会到达实际的测试方法,因此会被跳过。

此问题已在此处解决:
Starting test 'TestLogin::testHasLoginForm'.
S
Starting test 'TestLogin::testSomething'.
S