@@ -143,6 +143,34 @@ private void clickFieldOptions(String label)
143143 elementCache ().fieldOptionIconByLabel (label ).click ();
144144 }
145145
146+ public QueryChartDialog setLegendPos (String legendPos )
147+ {
148+
149+ if ("bottom" .equals (legendPos ))
150+ elementCache ().legendBottomRadio .check ();
151+ else if ("right" .equals (legendPos ))
152+ elementCache ().legendRightRadio .check ();
153+ else
154+ throw new IllegalArgumentException ("Invalid legend value: " + legendPos );
155+
156+ return this ;
157+ }
158+
159+ public String getLegendPos ()
160+ {
161+ if (elementCache ().legendBottomRadio .isChecked ())
162+ return "bottom" ;
163+ else if (elementCache ().legendRightRadio .isChecked ())
164+ return "right" ;
165+
166+ throw new IllegalStateException ("Unexpected legend position" );
167+ }
168+
169+ public boolean isLegendPosVisible ()
170+ {
171+ return elementCache ().legendBottomRadio .isDisplayed () && elementCache ().legendRightRadio .isDisplayed ();
172+ }
173+
146174 /**
147175 * Set the axis scale to 'linear' or 'log' for the given axis
148176 * @param label the axis label
@@ -717,6 +745,8 @@ public WebElement svg()
717745 public RadioButton scaleLogRadio = RadioButton .RadioButton (Locator .radioButtonByNameAndValue ("scaleTrans" , "log" )).refindWhenNeeded (fieldOptionPopover );
718746 public RadioButton scaleAutomaticRadio = RadioButton .RadioButton (Locator .radioButtonByNameAndValue ("scaleType" , "automatic" )).refindWhenNeeded (fieldOptionPopover );
719747 public RadioButton scaleManualRadio = RadioButton .RadioButton (Locator .radioButtonByNameAndValue ("scaleType" , "manual" )).refindWhenNeeded (fieldOptionPopover );
748+ public RadioButton legendRightRadio = RadioButton .RadioButton (Locator .radioButtonByNameAndValue ("legendPos" , "right" )).refindWhenNeeded (settingsPanel );
749+ public RadioButton legendBottomRadio = RadioButton .RadioButton (Locator .radioButtonByNameAndValue ("legendPos" , "bottom" )).refindWhenNeeded (settingsPanel );
720750 public Input scaleRangeMinInput = Input (Locator .input ("scaleMin" ), getDriver ()).refindWhenNeeded (fieldOptionPopover );
721751 public Input scaleRangeMaxInput = Input (Locator .input ("scaleMax" ), getDriver ()).refindWhenNeeded (fieldOptionPopover );
722752 public Input yLabelInput = Input (Locator .input ("y-label" ), getDriver ()).refindWhenNeeded (fieldOptionPopover );
0 commit comments