Replace two variables in all examples:
- replace "
modelName
" with the name of your model - replace "
value
" with the value of your form attribute
Select item:
1a. Selecting item from a select (dropdown) list:
select('modelName').option('value');
1b. Selecting item in a radio button:
input('modelName').select('value');
1c. Checking a checkbox:
input('modelName').check();
Check if selected:
2a. Check item in a select (dropdown) list:
expect(input('modelName').val()).toEqual(value);
2b. Check item in a radio button
expect(element('input[ng-model="modelName"]:checked').val()).toEqual(value);
2c. Check item in a checkbox
expect(element('input[ng-model="modelName"]').prop('checked')).toBeTruthy();