@@ -20,29 +20,22 @@ public void click(String value) {
2020
2121 @ JDIAction ("'{name}' radio button with value '{0}' is checked" )
2222 public boolean isChecked (String value ) {
23- return getRadioButtonByValue (value ).attr ( "class" ). contains ( "mat-mdc-radio-checked" );
23+ return getRadioButtonByValue (value ).isChecked ( );
2424 }
2525
26- @ JDIAction ("Get radio-button by value {0}" )
26+ @ JDIAction ("Get radio-button by value ' {0}' " )
2727 public RadioButton getRadioButtonByValue (String value ) {
28- RadioButton radioButton = null ;
29- for (RadioButton e : radioButtons ()) {
30- if (e .find ("input" ).attr ("value" ).equalsIgnoreCase (value )) {
31- radioButton = e ;
32- }
33- }
34- return radioButton ;
28+ return radioButtons ().stream ()
29+ .filter (radioButton -> radioButton .value ().equalsIgnoreCase (value ))
30+ .findFirst ()
31+ .orElse (null );
3532 }
36-
3733 @ JDIAction ("Get '{name}' checked radio-button" )
3834 public RadioButton getCheckedRadioButton () {
39- RadioButton radioButton = null ;
40- for (RadioButton e : radioButtons ()) {
41- if (e .isChecked ()) {
42- radioButton = e ;
43- }
44- }
45- return radioButton ;
35+ return radioButtons ().stream ()
36+ .filter (RadioButton ::isChecked )
37+ .findFirst ()
38+ .orElse (null );
4639 }
4740
4841 public List <RadioButton > radioButtons () {
@@ -56,11 +49,16 @@ public boolean isGroupBeforePosition() {
5649 return core ().attr ("labelposition" ).equalsIgnoreCase ("before" );
5750 }
5851
52+ @ Override
5953 @ JDIAction ("'{name}' is disabled" )
6054 public boolean isDisabled () {
6155 return core ().hasAttribute ("disabled" );
6256 }
6357
58+ @ Override
59+ @ JDIAction ("'{name}' is enabled" )
60+ public boolean isEnabled () { return core ().hasAttribute ("enabled" ); }
61+
6462 @ JDIAction ("'{name}' is required" )
6563 public boolean isRequired () {
6664 return core ().hasAttribute ("required" );
0 commit comments