checkOption() public method

Ticks a checkbox. For radio buttons, use the selectOption method instead. php checkOption('#agree'); ?>
See also: Codeception\Lib\InnerBrowser::checkOption()
public checkOption ( $option )
$option
示例#1
0
     $I->fillField('#add_new_authcode .authcode_advantage_code', $authcode['advantage_code']);
     $I->fillField('#add_new_authcode .authcode_description', $authcode['description']);
     $I->selectOption('#add_new_authcode .authcode_type', $authcode['auth_type']);
     $I->click('Add New', '#add_new_authcode');
     $I->waitForJS('return jQuery.active == 0', 5);
     $I->see($authcode['description']);
 }
 $I->amGoingTo('Insert some Test Content');
 foreach ($pubcodes[$a] as $authcode) {
     $I->amOnPage('/wp-admin/post-new.php');
     $I->fillField('post_title', 'Test Post for ' . $authcode['description']);
     $I->click('Text');
     $I->fillField('content', 'Content for ' . $authcode['description']);
     $I->click('Visual');
     $I->fillField('excerpt', 'Excerpt for ' . $authcode['description']);
     $I->checkOption('#pubcode_' . $authcode['name']);
     $I->wait(2);
     $I->click('Publish', '#publishing-action');
     $I->see('Post Published');
     $I->seeCheckboxIsChecked('#pubcode_' . $authcode['name']);
 }
 $I->amGoingTo('Log Out so we can check that the content is password protected');
 $WP->logout();
 $I->amGoingTo('Test the protected content');
 foreach ($pubcodes[$a] as $authcode) {
     $I->amOnPage('/');
     $I->click('Test Post for ' . $authcode['description']);
     $I->see('Enter your username and password below');
     $I->fillField('log', $sample_accounts[$a]['username']);
     $I->fillField('pwd', $sample_accounts[$a]['password']);
     $I->click('Log In');