1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.jameleon.plugin.jiffie.tags;
21
22 import net.sf.jameleon.plugin.jiffie.IEFunctionTag;
23
24 /***
25 * Verifies that a radio button has been set to a given value.
26 *
27 * Some example uses might be:
28 *
29 * Verify the following radio buttons <input type="radio" name="radioButton" value="radio1"><input type="radio" name="radioButton" value="radio2">
30 * <pre><source>
31 * <ie-validate-radiobutton functionId="Validate that the radio button named 'radioButton' is selected to radio2"
32 * name="radioButton"
33 * value="radio2"
34 * form="testForm"/>
35 * </source></pre>
36 * @jameleon.function name="ie-validate-radiobutton" type="validation"
37 * @jameleon.step Find the given form and set it as the working form
38 * @jameleon.step Find the given radio button and validate whether it is selected
39 */
40 public class IEValidateRadiobuttonTag extends IEFunctionTag {
41
42 /***
43 * The name of the radio button
44 * @jameleon.attribute required="true" contextName="ieValidateRadiobuttonName"
45 */
46 protected String name;
47
48 /***
49 * Which value is set in the radio button
50 * @jameleon.attribute required="true" contextName="ieValidateRadiobuttonValue"
51 */
52 protected String value;
53
54 /***
55 * The name, id or index of the field
56 * @jameleon.attribute contextName="ieValidateRadiobuttonForm"
57 */
58 protected String form;
59
60 public void testBlock() {
61 setWorkingForm(form);
62 assertRadioButtonChecked(name, value);
63 }
64 }