githubjeka / yii2-tutorial

Yii2 учебное руководство, мануал по созданию сайта на русском языке.
Other
133 stars 31 forks source link

Знакомство с тестированием. Ошибка при запуске codecept run functional functional\InterviewCept.php #22

Open dye491 opened 8 years ago

dye491 commented 8 years ago

Добрый день,

У меня функциональный тест выполняется с ошибками, вот скриншот вывода команды codecept run functional functional\InterviewCept.php:

Codeception PHP Testing Framework v2.2.3 Powered by PHPUnit 5.4.8 by Sebastian Bergmann and contributors.

Tests\codeception\frontend.functional Tests (1) ------------
## E InterviewCept: Be sure that the page with the form of "interrogation" works. (0.21s)

1) InterviewCept: Be sure that the page with the form of "interrogation" works.
 Test  functional\InterviewCept.php
                                                                                                                                     
  [LogicException] A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is hidden).  
                                                                                                                                     

Scenario Steps:

 18. $I->selectOption("[name="Interview[sex]"]","1")
1. $I->fillField("input[name="Interview[name]"]","Иванов")
2. // I am going to отправить форму c корректными данными
3. $I->see("Проверочный код введён неве...",".help-block")
4. // I expect to увидеть ошибки валидации каптчи
5. $I->click("interview-submit")
#1  C:\var\www\codecept\vendor\symfony\dom-crawler\Field\FormField.php:57
#2  Codeception\Lib\InnerBrowser->selectOption
#3  C:\var\www\yii2-tutorial\yii2-app-advanced\tests\codeception\frontend_support_generated\FunctionalTesterActions.php:2140
#4  C:\var\www\yii2-tutorial\yii2-app-advanced\tests\codeception\frontend_pages\InterviewPage.php:30
#5  C:\var\www\yii2-tutorial\yii2-app-advanced\tests\codeception\frontend\functional\InterviewCept.php:38

Time: 830 ms, Memory: 16.75MB

There was 1 error:

---

ERRORS!
Tests: 1, Assertions: 6, Errors: 1.

В чем может быть причина? Я подозреваю, что из-за того, что в html-коде страницы поля с именами Interview[sex], Interview[planets], Interview[astronauts], Interview[planet] пристутствуют дважды - одно типа hidden, а другое radio или checkbox или dropdown.

Это можно побороть?