This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,15 @@ public function testShouldGetFirstSelectedOptionConsideringOnlyElementsAssociate
6868 $ this ->assertEquals ('j5b ' , $ checkboxes ->getFirstSelectedOption ()->getAttribute ('value ' ));
6969 }
7070
71+ public function testShouldGetFirstSelectedOptionConsideringOnlyElementsAssociatedWithCurrentFormWithoutId ()
72+ {
73+ $ checkboxes = new WebDriverCheckboxes (
74+ $ this ->driver ->findElement (WebDriverBy::xpath ('//input[@id="j5d"] ' ))
75+ );
76+
77+ $ this ->assertEquals ('j5c ' , $ checkboxes ->getFirstSelectedOption ()->getAttribute ('value ' ));
78+ }
79+
7180 public function testSelectByValue ()
7281 {
7382 $ selectedOptions = ['j2b ' , 'j2c ' ];
Original file line number Diff line number Diff line change @@ -60,9 +60,18 @@ public function testGetFirstSelectedOption()
6060
6161 public function testShouldGetFirstSelectedOptionConsideringOnlyElementsAssociatedWithCurrentForm ()
6262 {
63- $ radio = new WebDriverRadios ($ this ->driver ->findElement (WebDriverBy::xpath ('//input[@id="j4b"] ' )));
63+ $ radios = new WebDriverRadios ($ this ->driver ->findElement (WebDriverBy::xpath ('//input[@id="j4b"] ' )));
6464
65- $ this ->assertEquals ('j4b ' , $ radio ->getFirstSelectedOption ()->getAttribute ('value ' ));
65+ $ this ->assertEquals ('j4b ' , $ radios ->getFirstSelectedOption ()->getAttribute ('value ' ));
66+ }
67+
68+ public function testShouldGetFirstSelectedOptionConsideringOnlyElementsAssociatedWithCurrentFormWithoutId ()
69+ {
70+ $ radios = new WebDriverRadios (
71+ $ this ->driver ->findElement (WebDriverBy::xpath ('//input[@id="j4c"] ' ))
72+ );
73+
74+ $ this ->assertEquals ('j4c ' , $ radios ->getFirstSelectedOption ()->getAttribute ('value ' ));
6675 }
6776
6877 public function testSelectByValue ()
Original file line number Diff line number Diff line change 5353< form id ="another-form ">
5454 < input type ="checkbox " name ="single-cb ">
5555</ form >
56+
57+ <!-- Form without id -->
58+ < form >
59+ < label for ="j5c "> J5C</ label >
60+ < input type ="checkbox " name ="j5 " value ="j5c " id ="j5c " checked />
61+ < label for ="j5d "> J5D</ label >
62+ < input type ="checkbox " name ="j5 " value ="j5d " id ="j5d " checked />
63+
64+ < label for ="j4c "> J4C</ label >
65+ < input type ="radio " name ="j4 " value ="j4c " id ="j4c " checked >
66+ </ form >
67+
5668</ body >
5769</ html >
You can’t perform that action at this time.
0 commit comments