Skip to content
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

Merged
merged 5 commits into from
Oct 11, 2018

Conversation

Ohrimenko1988
Copy link
Contributor

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

@Ohrimenko1988 Ohrimenko1988 added kind/bug Outline of a bug - must adhere to the bug report template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. team/che-qe labels Oct 11, 2018
* @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) {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Oct 11, 2018

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
Copy link
Contributor

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
Copy link
Contributor

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]";
Copy link
Contributor

@dmytro-ndp dmytro-ndp Oct 11, 2018

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]";
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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
Copy link
Contributor

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 =
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isKeyBindingFieldExists > isKeyBindingFieldExisted

@Ohrimenko1988 Ohrimenko1988 merged commit af18323 into master Oct 11, 2018
@Ohrimenko1988 Ohrimenko1988 deleted the selen-adapt-theia branch October 11, 2018 15:32
@Ohrimenko1988 Ohrimenko1988 removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 11, 2018
@benoitf benoitf added this to the 6.13.0 milestone Oct 11, 2018
nickboldt pushed a commit to nickboldt/che that referenced this pull request Oct 15, 2018
nickboldt pushed a commit to nickboldt/che that referenced this pull request Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants