OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 | |
keishi
2014/10/06 10:52:32
radio-checked-LastorFirst-then-DownorUp-keyDown.ht
Paritosh Kumar
2014/10/06 12:51:29
Thanks.
Done.
| |
3 <body> | |
4 <script src="../resources/common.js"></script> | |
5 | |
6 <script src="../../../resources/js-test.js"></script> | |
7 | |
8 <form name=alpha> | |
9 <input type="radio" name="fruit" id="apple"><br> | |
10 <input type="radio" name="fruit" id="banana"><br> | |
11 <input type="radio" name="fruit" id="cherry"><br> | |
12 <input type="radio" name="fruit" form=beta id="tomato"><br> | |
13 </form> | |
14 <form name=beta> | |
15 <input type="radio" name="fruit" id="pumpkin"><br> | |
16 </form> | |
17 <input type="radio" name="fruit" form=alpha id="cucumber"><br> | |
18 | |
19 <script> | |
20 document.alpha.insertBefore(document.beta, document.alpha.fruit[2]); | |
keishi
2014/10/06 10:52:32
You probably forgot to remove this line.
Paritosh Kumar
2014/10/06 12:51:29
Apologize. Done.
Thanks.
| |
21 document.alpha.appendChild(document.beta); | |
22 description('Tests after pressing last radio button in the list, on pressing dow nkey it selects back first radio button'); | |
23 clickElement(document.getElementById('cherry')); | |
keishi
2014/10/06 10:52:32
nit: You could use the $(id) defined in common.js
| |
24 shouldBeTrue('document.getElementById("cherry").checked'); | |
25 | |
26 eventSender.keyDown('downArrow'); | |
27 shouldBeTrue('document.getElementById("apple").checked'); | |
28 | |
29 eventSender.keyDown('upArrow'); | |
30 shouldBeTrue('document.getElementById("cherry").checked'); | |
31 | |
32 | |
33 clickElement(document.getElementById('cucumber')); | |
34 shouldBeTrue('document.getElementById("cucumber").checked'); | |
35 | |
36 eventSender.keyDown('downArrow'); | |
37 shouldBeTrue('document.getElementById("tomato").checked'); | |
38 | |
39 eventSender.keyDown('upArrow'); | |
40 shouldBeTrue('document.getElementById("cucumber").checked'); | |
keishi
2014/10/06 10:52:32
nit: Could you add a comment here explaining that
Paritosh Kumar
2014/10/06 12:36:33
Actually for both radio button, form() returns 0 a
| |
41 | |
42 clickElement(document.getElementById('pumpkin')); | |
43 shouldBeTrue('document.getElementById("pumpkin").checked'); | |
44 | |
45 eventSender.keyDown('downArrow'); | |
46 shouldBeTrue('document.getElementById("pumpkin").checked'); | |
47 | |
48 eventSender.keyDown('upArrow'); | |
49 shouldBeTrue('document.getElementById("pumpkin").checked'); | |
50 | |
51 </script> | |
52 </body> | |
53 | |
OLD | NEW |