package com.sdl.selenium.extjs6.button;

import com.sdl.selenium.web.SearchType;
import com.sdl.selenium.web.WebLocator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SplitButton extends Button {
    private static final Logger LOGGER = LoggerFactory.getLogger(SplitButton.class);

    public SplitButton() {
        withClassName("SplitButton");
    }

    public SplitButton(WebLocator container) {
        this();
        withContainer(container);
    }

    public SplitButton(WebLocator container, String text) {
        this(container);
        withText(text);
    }

    public boolean clickOnMenu(String option) {
        return clickOnMenu(new String[]{option});
    }

    public boolean clickOnMenu(String[] menuOptions) {
        int n = menuOptions.length;
        LOGGER.debug("clickOnMenu : " + menuOptions[n - 1]);
        assertReady();
        boolean selected = true;
        if (showMenu()) {
            for (String val : menuOptions) {
                WebLocator option = getComboEl(val, false, 300);
                selected = selected && option.click();
            }
        } else {
            LOGGER.debug("(" + toString() + ") The element arrow could not be located.");
            selected = false;
        }
        return selected;
    }

    private WebLocator getComboEl(String value, boolean startWith, long optionRenderMillis) {
        WebLocator comboListElement = new WebLocator("x-menu").withAttribute("aria-hidden", "false").withInfoMessage(this + " -> x-menu");
        return new WebLocator(comboListElement).withText(value, startWith ? SearchType.STARTS_WITH : SearchType.EQUALS).withRenderMillis(optionRenderMillis).withInfoMessage(value);
    }
}

@@ -172,16 +172,65 @@
 ctory;%0A%0A
+import java.util.Arrays;%0Aimport java.util.List;%0A%0A
 public c
@@ -1334,24 +1334,346 @@
 ted;%0A    %7D%0A%0A
+    public List%3CString%3E getAllSplitButtonValues() %7B%0A        click();%0A        WebLocator comboList = new WebLocator(new WebLocator(%22x-menu%22)).withClasses(%22x-menu-body%22).withVisibility(true);%0A        String%5B%5D comboValues = comboList.getText().split(%22%5C%5Cn%22);%0A        click();%0A        return Arrays.asList(comboValues);%0A    %7D%0A%0A
     private 

Add getAllSplitButtonValues() to SplitButton