public static void pressButtonByText(Container container, String buttonText,
			boolean waitForCompletion) {

		AbstractButton button = findAbstractButtonByText(container, buttonText);
		if (button == null) {
			throw new AssertionError("Couldn't find button " + buttonText + ".");
		}
		if (!runSwing(() -> button.isShowing())) {
			throw new AssertionError("Button " + buttonText + " is not showing.");
		}
		if (!runSwing(() -> button.isEnabled())) {
			throw new AssertionError("Button " + buttonText + " is not enabled.");
		}
		pressButton(button, waitForCompletion);
	}
Finds the button with the indicated TEXT that is a sub-component of the
indicated container, and then programmatically presses the button.

@param container the container to search. (Typically a dialog.)
@param buttonText the text on the desired JButton.
@param waitForCompletion if true wait for action to complete before
           returning, otherwise schedule action to be performed and
           return immediately.
@throws AssertionError if the button isn't found, isn't showing or isn't
            enabled
Ghidra/Framework/Gui/src/main/java/generic/test/AbstractGuiTest.java