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

Implement selenium test for covering LS server for PHP language #9805

Merged
merged 8 commits into from
May 25, 2018

Conversation

musienko-maxim
Copy link
Contributor

@musienko-maxim musienko-maxim commented May 24, 2018

What does this PR do?

  • This PR implements simple scenario: create a workspace with enabled PHP LS installer, open simple php project, check initialization PHP LS by UI and checks code validation, autocompletion, go to definition.
  • Also was added new locator in the TestMenuCommandsConstants class for invocation Find definition command. Have been changed webDriverWaitFactory to seleniumWebDriverHelper for better readability and simplify code

What issues does this PR fix or reference?

#9760

@benoitf benoitf added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. labels May 24, 2018
@musienko-maxim
Copy link
Contributor Author

ci-build

editor.waitActive();
}

@Test()
Copy link
Contributor

Choose a reason for hiding this comment

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

() looks redundant here

}

private void checkAutocompletion() {
editor.goToCursorPositionVisible(13, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, divide separate steps by empty rows to improve readability.

}

private void checkCodeValidation() {
editor.goToPosition(14, 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, divide separate steps by empty rows to improve readability.

import org.testng.annotations.Test;

/** @author Musienko Maxim */
public class PhpLanguageServerTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

We actually have test for another language with completely different name CheckMainFeatureForCSharpLanguageTest.
Let's unify naming scheme. In fact, we don't test language server itself. So server in test name looks confusing, as for me.

What about next test names?

  • CSharpFileEditingTest
  • PhpFileEditingTest

String.format(
"Finished language servers initialization, file path '/%s'", PATH_TO_INDEX_PHP);
consoles.waitExpectedTextIntoConsole(intitPhpLanguageServerMessage);
checkCodeValidation();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, divide separate steps by empty rows to improve readability.


@Test()
public void checkMainFeaturesPhpLS() {
String intitPhpLanguageServerMessage =
Copy link
Contributor

Choose a reason for hiding this comment

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

typo here: "intit"


@BeforeClass
public void setup() throws Exception {
URL resource = getClass().getResource("/projects/plugins/DebuggerPlugin/php-tests");
Copy link
Contributor

Choose a reason for hiding this comment

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

We can define this URL at the class loading time. So, it's better to extract this URL as a constant.

@Test()
public void checkMainFeaturesPhpLS() {
@Test
public void PhpFileEditingTest() {
Copy link
Contributor

Choose a reason for hiding this comment

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

old name of test looked better

@codenvy-ci
Copy link

@musienko-maxim
Copy link
Contributor Author

ci-build

@codenvy-ci
Copy link

@musienko-maxim musienko-maxim merged commit a2473ae into master May 25, 2018
@musienko-maxim musienko-maxim deleted the CHE-9760 branch May 25, 2018 12:57
@benoitf benoitf added this to the 6.6.0 milestone May 25, 2018
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label May 25, 2018
hbhargav pushed a commit to hbhargav/che that referenced this pull request Dec 5, 2018
…pse-che#9805)

* Implement selenium test for covering LS server for PHP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants