开发者

Can I check a checkbox in CodeCeption without a form?

I'm trying to write a test using CodeCeption for a page that looks like this:

Can I check a checkbox in CodeCeption without a form?

My code for the test is the following:

// tests
public function tryToUnifyAgents(FunctionalTester $I)
{
    $I->amLoggedInAs($this->operator);
    $I->amOnRoute('agent_index');
    $firstAgent = $I->grabAgentFromDB(self::FIRST_AGENT_NAME);
    $I->seeElement('#agent_' . $firstAgent->getId());
    $I->checkOption('#agent_' . $firstAgent->getId());
    $secondAgent = $I->grabAgentFromDB(self::SECOND_AGENT_NAME);

    $I->seeElement('#agent_' . $secondAgent->getId());
}

I have all the needed objects in the database but when I run this test I get "The current node list is empty.".

I run the code with XDebug and noticed that t开发者_运维知识库he exception is raised because there's no form containing the checkbox. Is there some way to go around this?

Thanks,

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜