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:
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,
精彩评论