Skip to content

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

Open
@dye491

Description

@dye491

Добрый день,

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

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

�[1mTests\codeception\frontend.functional Tests (1) �[22m------------
## �[31;1mE�[39;22m �[35;1mInterviewCept:�[39;22m Be sure that the page with the form of "interrogation" works. �[32m(0.21s)�[39m

1) �[35;1mInterviewCept:�[39;22m Be sure that the page with the form of "interrogation" works.
�[37;41;1m Test �[39;49;22m functional\InterviewCept.php
�[37;41;1m                                                                                                                                     �[39;49;22m
�[37;41;1m  [LogicException] A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is hidden).  �[39;49;22m
�[37;41;1m                                                                                                                                     �[39;49;22m
�[33m
Scenario Steps:
�[39m
�[1m 18. $I->selectOption("[name="Interview[sex]"]","1")�[22m
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:

---

�[37;41mERRORS!�[0m
�[37;41mTests: 1�[0m�[37;41m, Assertions: 6�[0m�[37;41m, Errors: 1�[0m�[37;41m.�[0m

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions