Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
systems:yii2:testing_examples [2018/04/24 15:01]
smayr [Comments]
systems:yii2:testing_examples [2018/04/24 15:44] (current)
smayr [Forms]
Line 176: Line 176:
     $I->see('Login');     $I->see('Login');
 }     }    
 +</code>
 +
 +With fields, you can fill them in several says, all meaning the same thing:
 +<code php>
 +// All equivalent (input box)
 +$I->fillField('input',   ['name' => 'UserSearch[username]'], 'demo');
 +$I->fillField(['name' => 'UserSearch[username]'], 'demo');
 +$I->fillField('UserSearch[username]', 'demo');
 +$I->fillField('#user-username', 'demo');
 +$I->fillField('#myformname input=[UserSearch[username]]', 'demo');
 +$I->fillField('input=[UserSearch[username]]', 'demo');
 +$I->fillField(['id' => 'user-username'], 'demo');
 +$I->fillField('input[id=user-username]', 'demo');
 +
 +// All equivalent (selection box)
 +$I->seeOptionIsSelected('form select[id=user-status]', 'inactive');      // status: inactive
 +$I->seeOptionIsSelected('select[id=user-status]', 'inactive');           // status: inactive
 +$I->seeOptionIsSelected('#user-status', 'inactive');                     // status: inactive
 </code> </code>