-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Selenium] Adapt the "TheiaBuildPluginTest" selenium test to changes in the top menu #11595
Conversation
* @param cssPropertyName name of the css properties which should be extracted | ||
* @return value of the specified {@code cssPropertyName} | ||
*/ | ||
public String waitAndGetCss(By elementLocator, String cssPropertyName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitAndGetCss
sounds too general. waitAndGetCssgetCssValue
would be clear in this case, IMHO.
* Waits visibility of element which specified by {@code elementLocator} and gets provided {@code | ||
* cssPropertyName} from it. | ||
* | ||
* @param elementLocator locator of the investigated element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
investigated
> investigating
* Waits until specified {@code cssPropertyName} in the element which defined by provided {@code | ||
* elementLocator} is equals to {@code expectedValue}. | ||
* | ||
* @param elementLocator locator of the investigated element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
investigated
> investigating
@@ -59,20 +62,82 @@ private TheiaTerminal( | |||
|
|||
public interface Locators { | |||
String TERMINAL_BODY_ID_TEMPLATE = "terminal-%s"; | |||
String TERMINAL_TEXT_LAYER = "//canvas[@class='xterm-text-layer']"; | |||
String TERMINAL_CURSOR_LAYER = "//canvas[@class='xterm-cursor-layer']"; | |||
String TERMINAL_TEXT_LAYER = "(//canvas[@class='xterm-text-layer'])[%s]"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ _TEMPLATE
String TERMINAL_TEXT_LAYER = "//canvas[@class='xterm-text-layer']"; | ||
String TERMINAL_CURSOR_LAYER = "//canvas[@class='xterm-cursor-layer']"; | ||
String TERMINAL_TEXT_LAYER = "(//canvas[@class='xterm-text-layer'])[%s]"; | ||
String TERMINAL_CURSOR_LAYER = "(//canvas[@class='xterm-cursor-layer'])[%s]"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ _TEMPLATE
} | ||
|
||
private WebElement getTerminalTextLayer() { | ||
return seleniumWebDriverHelper.waitVisibility(By.xpath(TERMINAL_TEXT_LAYER)); | ||
private String getTerminalCursorLayer(int terminalIndex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getTerminalCursorLayer
-> getTerminalCursorLayerXpath
return seleniumWebDriverHelper.waitVisibility(By.xpath(terminalTextLayerXpath)); | ||
} | ||
|
||
public void waitTabSelected(String tabTitle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there are two patterns of method names includesTerminal
. It looks redundant so as it is about Theia Terminal anyway.
String WIDGET_BODY_XPATH = "//div[@class='monaco-quick-open-widget']"; | ||
String SEARCH_FIELD_XPATH = WIDGET_BODY_XPATH + "//div[@class='quick-open-input']//input"; | ||
String TREE_ROWS_XPATH = | ||
WIDGET_BODY_XPATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve readability I would move WIDGET_BODY_XPATH to the previous row.
// for selection checking get "aria-selected" attribute. "true" if selected, "false" if not. | ||
String WIDGET_BODY_XPATH = "//div[@class='monaco-quick-open-widget']"; | ||
String SEARCH_FIELD_XPATH = WIDGET_BODY_XPATH + "//div[@class='quick-open-input']//input"; | ||
String TREE_ROWS_XPATH = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about renaming TREE_ROW
> PROPOSAL
?
return seleniumWebDriverHelper.waitVisibilityOfAllElements(By.xpath(TREE_ROWS_XPATH)).size(); | ||
} | ||
|
||
public boolean isKeyBindingFieldExists(int proposalIndex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isKeyBindingFieldExists
> isKeyBindingFieldExisted
What does this PR do?
Adapt the "TheiaBuildPluginTest" selenium test to changes in the top menu
What issues does this PR fix or reference?
Issue: #11545
Release Notes
Docs PR