@@ -45,6 +45,19 @@ public String getName()
4545 return elementCache ().nameInput .get ();
4646 }
4747
48+ public QueryChartDialog setTitle (String value ) {
49+ elementCache ().titleInput .set (value );
50+ elementCache ().title .click (); // blur the element
51+ return this ;
52+ }
53+
54+ public QueryChartDialog setSubtitle (String value )
55+ {
56+ elementCache ().subtitleInput .set (value );
57+ elementCache ().title .click (); // blur the element
58+ return this ;
59+ }
60+
4861 public QueryChartDialog setShared (boolean checked )
4962 {
5063 elementCache ().sharedCheckbox .set (checked );
@@ -266,6 +279,22 @@ public boolean isYAxisErrorBarOptionEnabled(String value)
266279 return enabled ;
267280 }
268281
282+ public QueryChartDialog setXAxisLabel (String value )
283+ {
284+ clickFieldOptions ("X Axis" );
285+ elementCache ().xLabelInput .set (value );
286+ Locator .tagWithText ("label" , "Name *" ).findElement (this ).click (); // close the popover
287+ return this ;
288+ }
289+
290+ public QueryChartDialog setYAxisLabel (String value )
291+ {
292+ clickFieldOptions ("Y Axis" );
293+ elementCache ().yLabelInput .set (value );
294+ Locator .tagWithText ("label" , "Name *" ).findElement (this ).click (); // close the popover
295+ return this ;
296+ }
297+
269298 /*
270299 groupBy is an option for bar charts only
271300 */
@@ -537,13 +566,13 @@ protected ElementCache elementCache()
537566
538567 protected class ElementCache extends ModalDialog .ElementCache
539568 {
540- final Input nameInput = Input (Locator .input ("name" ), getDriver ()).findWhenNeeded (this );
541- final Checkbox sharedCheckbox = Checkbox .Checkbox (Locator .input ("shared" )).findWhenNeeded (this );
542- final Checkbox inheritableCheckbox = Checkbox .Checkbox (Locator .input ("inheritable" )).findWhenNeeded (this );
543569 Locator .XPathLocator settingsPanelLoc = Locator .byClass ("chart-builder-modal__settings-panel" );
544570 final WebElement settingsPanel = settingsPanelLoc .findWhenNeeded (this );
545-
546- Locator .XPathLocator chartBuilderType = Locator .tagWithClass ("div" , "chart-builder-type" );
571+ final Input nameInput = Input (Locator .input ("name" ), getDriver ()).findWhenNeeded (settingsPanel );
572+ final Input titleInput = Input (Locator .input ("main-label" ), getDriver ()).findWhenNeeded (settingsPanel );
573+ final Input subtitleInput = Input (Locator .input ("subtitle-label" ), getDriver ()).findWhenNeeded (settingsPanel );
574+ final Checkbox sharedCheckbox = Checkbox .Checkbox (Locator .input ("shared" )).findWhenNeeded (settingsPanel );
575+ final Checkbox inheritableCheckbox = Checkbox .Checkbox (Locator .input ("inheritable" )).findWhenNeeded (settingsPanel );
547576
548577 public ReactSelect reactSelectByLabel (String label )
549578 {
@@ -564,7 +593,7 @@ public WebElement fieldOptionIconByLabel(String label)
564593 Locator loc = Locator .tag ("div" ).withChild (Locator .tagContainingText ("label" , label ));
565594 return Locator .tagWithClass ("div" , "field-option-icon" ).descendant ("span" ).findElementOrNull (loc .findElement (this ));
566595 }
567- private final Locator .XPathLocator previewContainerLoc = Locator .tag ("div" ).withChild (Locator .tagWithText ("label " , "Preview" ));
596+ private final Locator .XPathLocator previewContainerLoc = Locator .tag ("div" ).withChild (Locator .tagWithText ("h4 " , "Preview" ));
568597 public WebElement previewContainer ()
569598 {
570599 return previewContainerLoc .waitForElement (this , 1500 );
@@ -590,6 +619,8 @@ public WebElement svg()
590619 public RadioButton scaleManualRadio = RadioButton .RadioButton (Locator .radioButtonByNameAndValue ("scaleType" , "manual" )).refindWhenNeeded (fieldOptionPopover );
591620 public Input scaleRangeMinInput = Input (Locator .input ("scaleMin" ), getDriver ()).refindWhenNeeded (fieldOptionPopover );
592621 public Input scaleRangeMaxInput = Input (Locator .input ("scaleMax" ), getDriver ()).refindWhenNeeded (fieldOptionPopover );
622+ public Input yLabelInput = Input (Locator .input ("y-label" ), getDriver ()).refindWhenNeeded (fieldOptionPopover );
623+ public Input xLabelInput = Input (Locator .input ("x-label" ), getDriver ()).refindWhenNeeded (fieldOptionPopover );
593624
594625 final Locator .XPathLocator radioGroupLoc = Locator .byClass ("field-option-radio-group" );
595626
0 commit comments