selectOption() public method

Selects an option in a select tag or in radio button group. php selectOption('form select[name=account]', 'Premium'); $I->selectOption('form input[name=payment]', 'Monthly'); $I->selectOption('//form/select[@name=account]', 'Monthly'); ?> Provide an array for the second argument to select multiple options: php selectOption('Which OS do you use?', array('Windows','Linux')); ?>
See also: Codeception\Lib\InnerBrowser::selectOption()
public selectOption ( $select, $option )
$select
$option
 public function _changeTo(WebGuy $I, $datastore = 'Candidate')
 {
     $I->selectOption('#form_source', $datastore);
     $I->expectTo('change datastore to ' . $datastore);
     $I->waitForElementNotVisible('#ajax-spinner');
     $I->waitForText('Config data only');
 }
$I->click('Add contact');
$I->fillField('input#email1', '*****@*****.**');
$I->seeInField('input#email0', '*****@*****.**');
$I->seeInField('input#email1', '*****@*****.**');
//-----------Fields done-----
//add more fields
$I->fillField('input#name', 'Some User');
$I->fillField('input#website', 'http://google.com');
$I->fillField('input#work_phone', '+308123456789');
$I->fillField('input#address1', 'Test Address 1');
$I->fillField('input#address2', 'Test Address 2 APPTMT SUITE');
$I->fillField('input#city', 'Zaporozhe');
$I->fillField('input#state', 'Test Province');
$I->fillField('input#postal_code', 'postcode 123455677');
$option = 'Net 7';
$I->selectOption("#payment_terms", $option);
$option = 'Euro';
$I->selectOption("#currency_id", $option);
$option = '500+';
$I->selectOption("#size_id", $option);
$option = 'Aerospace';
$I->selectOption("#industry_id", $option);
//----private notes
$I->fillField('#private_notes', 'Test Note Note Notes');
//-----------------------Form is Finished--
$I->click('Save');
$I->seeInCurrentUrl('/clients/');
$I->dontSeeInCurrentUrl('/users/');
$I->dontSeeInCurrentUrl('/user/');
$I->see('Details');
$I->see('Contacts');
示例#3
0
<?php

$I = new WebGuy($scenario);
$I->wantTo('submit contact form');
$I->amOnPage('fr/contact');
$I->selectOption('Titre', 'M.');
$I->fillField('first_name', 'John');
$I->fillField('last_name', 'Doe');
$I->fillField('email', '*****@*****.**');
$I->fillField('message', 'Hello');
$I->click('Envoyer');
$I->amOnPage('fr/contact');
示例#4
0
foreach ($affiliates as $a) {
    $I->amGoingTo('Input settings for the base plugin');
    $WP->admin_login();
    $I->amOnPage($plugins['base']['admin_page']);
    // Fill out the form
    $I->fillField('agora_core_framework_config[prod_token]', $mw_settings[$a]['prod_token']);
    $I->fillField('agora_core_framework_config[uat_token]', $mw_settings[$a]['uat_token']);
    $I->click('Save');
    $I->amGoingTo('Configure some Authcodes');
    $I->amOnPage($plugins['auth']['admin_page']);
    $I->see('Add new Authentication Code');
    foreach ($pubcodes[$a] as $authcode) {
        $I->fillField('#add_new_authcode .authcode_name', $authcode['name']);
        $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');