Php Codeception uncheckOption()不起作用

Php Codeception uncheckOption()不起作用,php,phalcon,codeception,Php,Phalcon,Codeception,我正在写一份表格的验收测试。测试选中复选框,测试复选框是否已选中,然后取消选中 因此,我的视图中有以下代码片段: <form> <div class="checkbox"> <label for="agree"></label> <input type="checkbox" id="agree" name="agree">Agree to the conditions! </div> <

我正在写一份表格的验收测试。测试选中复选框,测试复选框是否已选中,然后取消选中

因此,我的视图中有以下代码片段:

 <form>
    <div class="checkbox">
    <label for="agree"></label>
    <input type="checkbox" id="agree" name="agree">Agree to the conditions!
    </div>
</form>
我正在使用
PhpBrowser
驱动程序,因为我无法让
WebDriver
驱动程序在公司防火墙后工作

see element
see checkboxischecked
确认复选框存在并已选中时,以下
取消选中选项将不会成功

测试输出为:

2) Failed to check checkbox in WelcomeCept (tests\functional\\WelcomeCept.php)

 Step  I can dont see checkbox is checked "#agree"
 Fail  Failed asserting that 1 matches expected 0.

Scenario Steps:

     11. $I->canDontSeeCheckboxIsChecked("#agree") at tests\functional\WelcomeCept.php:18
     10. $I->uncheckOption("#agree") at tests\functional\WelcomeCept.php:17
     9. $I->seeCheckboxIsChecked("#agree") at tests\functional\WelcomeCept.php:15
     8. $I->checkOption("#agree") at tests\functional\WelcomeCept.php:14
     7. $I->dontSeeCheckboxIsChecked("#agree") at tests\functional\WelcomeCept.php:13
     6. $I->seeElement("#agree") at tests\functional\WelcomeCept.php:12
仅供参考,我正在使用Phalcon框架及其Volt模板引擎,页面在浏览器中的行为正常


感谢您的帮助。

取消选中选项是可行的,问题是CheckboxIsChecked断言检查页面的源,而不是测试设置的表单值

$I->dontSeeCheckboxIsChecked()方法对 生成的HTML并在输入上查找选中的属性 您指定的元素


谢谢我终于让Webdriver模块开始工作了(不得不取消设置代理环境变量),现在这种测试成为可能。
2) Failed to check checkbox in WelcomeCept (tests\functional\\WelcomeCept.php)

 Step  I can dont see checkbox is checked "#agree"
 Fail  Failed asserting that 1 matches expected 0.

Scenario Steps:

     11. $I->canDontSeeCheckboxIsChecked("#agree") at tests\functional\WelcomeCept.php:18
     10. $I->uncheckOption("#agree") at tests\functional\WelcomeCept.php:17
     9. $I->seeCheckboxIsChecked("#agree") at tests\functional\WelcomeCept.php:15
     8. $I->checkOption("#agree") at tests\functional\WelcomeCept.php:14
     7. $I->dontSeeCheckboxIsChecked("#agree") at tests\functional\WelcomeCept.php:13
     6. $I->seeElement("#agree") at tests\functional\WelcomeCept.php:12