Selenium: Do refactoring selenium tests (#12338)
parent
d67d0abbd3
commit
902ddc02fd
|
|
@ -54,7 +54,6 @@ public class GolangFileEditingTest {
|
|||
|
||||
private static final String PROJECT_NAME = "desktop-go-simple";
|
||||
private static final String GO_FILE_NAME = "main.go";
|
||||
private static final String LS_INIT_MESSAGE = "Finished running tool: /usr/local/go/bin/go build";
|
||||
private static final String FORMATTED_CODE =
|
||||
"package main\n"
|
||||
+ "\n"
|
||||
|
|
@ -97,7 +96,7 @@ public class GolangFileEditingTest {
|
|||
|
||||
@Inject private Ide ide;
|
||||
@Inject private Menu menu;
|
||||
@Inject private Consoles consoles;
|
||||
@Inject protected Consoles consoles;
|
||||
@Inject private CodenvyEditor editor;
|
||||
@Inject private ProjectExplorer projectExplorer;
|
||||
@Inject private TestProjectServiceClient testProjectServiceClient;
|
||||
|
|
@ -120,7 +119,7 @@ public class GolangFileEditingTest {
|
|||
|
||||
// check Golang language sever initialized
|
||||
consoles.selectProcessByTabName("dev-machine");
|
||||
consoles.waitExpectedTextIntoConsole(LS_INIT_MESSAGE);
|
||||
waitExpectedTextIntoConsole();
|
||||
}
|
||||
|
||||
@Test(priority = 1)
|
||||
|
|
@ -314,6 +313,7 @@ public class GolangFileEditingTest {
|
|||
// go to from second node
|
||||
openFindPanelAndPrintInputTetx("print");
|
||||
editor.pressArrowDown();
|
||||
https: // github.com/eclipse/che/issues/10524
|
||||
assistantFindPanel.waitActionNodeSelection(textSecondNode);
|
||||
editor.pressEnter();
|
||||
assistantFindPanel.waitFormIsClosed();
|
||||
|
|
@ -357,4 +357,9 @@ public class GolangFileEditingTest {
|
|||
textFirstNode = assistantFindPanel.getActionNodeText(0);
|
||||
textSecondNode = assistantFindPanel.getActionNodeText(1);
|
||||
}
|
||||
|
||||
protected void waitExpectedTextIntoConsole() {
|
||||
String lsInitMessage = "Finished running tool: /usr/local/go/bin/go build";
|
||||
consoles.waitExpectedTextIntoConsole(lsInitMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class JsonFileEditingTest {
|
|||
|
||||
@Inject private Ide ide;
|
||||
@Inject private Menu menu;
|
||||
@Inject private Wizard wizard;
|
||||
@Inject protected Wizard wizard;
|
||||
@Inject private Consoles consoles;
|
||||
@Inject private CodenvyEditor editor;
|
||||
@Inject private PullRequestPanel pullRequestPanel;
|
||||
|
|
@ -226,9 +226,13 @@ public class JsonFileEditingTest {
|
|||
projectExplorer.waitProjectExplorer();
|
||||
|
||||
menu.runCommand(WORKSPACE, CREATE_PROJECT);
|
||||
wizard.selectSample(NODEJS_HELLO_WORLD);
|
||||
selectSampleProject();
|
||||
wizard.typeProjectNameOnWizard(PROJECT_NAME);
|
||||
wizard.clickCreateButton();
|
||||
wizard.waitCloseProjectConfigForm();
|
||||
}
|
||||
|
||||
protected void selectSampleProject() {
|
||||
wizard.selectSample(NODEJS_HELLO_WORLD);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
package org.eclipse.che.selenium.languageserver.csharp;
|
||||
|
||||
import static org.eclipse.che.commons.lang.NameGenerator.generate;
|
||||
import static org.eclipse.che.selenium.core.TestGroup.FLAKY;
|
||||
import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR;
|
||||
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.CREATE_PROJECT;
|
||||
|
|
@ -22,7 +23,6 @@ import static org.openqa.selenium.Keys.BACK_SPACE;
|
|||
import static org.testng.Assert.fail;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.che.commons.lang.NameGenerator;
|
||||
import org.eclipse.che.selenium.core.SeleniumWebDriver;
|
||||
import org.eclipse.che.selenium.core.client.TestCommandServiceClient;
|
||||
import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient;
|
||||
|
|
@ -45,25 +45,25 @@ import org.testng.annotations.Test;
|
|||
/** @author Musienko Maxim */
|
||||
public class CSharpFileEditingTest {
|
||||
|
||||
private final String PROJECT_NAME = NameGenerator.generate("AspProject", 4);
|
||||
private final String LANGUAGE_SERVER_INIT_MESSAGE =
|
||||
protected final String PROJECT_NAME = generate("dotnet-web-simple-", 4);
|
||||
protected final String LANGUAGE_SERVER_INIT_MESSAGE =
|
||||
"Initialized language server 'org.eclipse.che.plugin.csharp.languageserver";
|
||||
private final String NAME_OF_EDITING_FILE = "Program.cs";
|
||||
protected final String NAME_OF_EDITING_FILE = "Program.cs";
|
||||
|
||||
@InjectTestWorkspace(template = WorkspaceTemplate.UBUNTU_LSP)
|
||||
private TestWorkspace workspace;
|
||||
|
||||
@Inject private Ide ide;
|
||||
@Inject private ProjectExplorer projectExplorer;
|
||||
@Inject protected ProjectExplorer projectExplorer;
|
||||
@Inject private Loader loader;
|
||||
@Inject private CodenvyEditor editor;
|
||||
@Inject protected CodenvyEditor editor;
|
||||
@Inject private Menu menu;
|
||||
@Inject private Wizard wizard;
|
||||
@Inject private SeleniumWebDriver seleniumWebDriver;
|
||||
@Inject private TestCommandServiceClient testCommandServiceClient;
|
||||
@Inject private CommandsPalette commandsPalette;
|
||||
@Inject private TestWorkspaceServiceClient testWorkspaceServiceClient;
|
||||
@Inject private Consoles consoles;
|
||||
@Inject protected Consoles consoles;
|
||||
|
||||
@BeforeClass
|
||||
public void setUp() throws Exception {
|
||||
|
|
@ -115,7 +115,7 @@ public class CSharpFileEditingTest {
|
|||
checkAutocompletion();
|
||||
}
|
||||
|
||||
private void initLanguageServer() {
|
||||
protected void initLanguageServer() {
|
||||
projectExplorer.quickRevealToItemWithJavaScript(PROJECT_NAME + "/" + NAME_OF_EDITING_FILE);
|
||||
projectExplorer.openItemByPath(PROJECT_NAME + "/" + NAME_OF_EDITING_FILE);
|
||||
consoles.selectProcessByTabName("dev-machine");
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class CheckShowHideHiddenFilesTest {
|
|||
@Inject private Loader loader;
|
||||
@Inject private CodenvyEditor editor;
|
||||
@Inject private Menu menu;
|
||||
@Inject private Wizard projectWizard;
|
||||
@Inject protected Wizard projectWizard;
|
||||
@Inject private Consoles consoles;
|
||||
|
||||
@BeforeClass
|
||||
|
|
@ -81,7 +81,7 @@ public class CheckShowHideHiddenFilesTest {
|
|||
TestMenuCommandsConstants.Workspace.CREATE_PROJECT);
|
||||
projectWizard.waitCreateProjectWizardForm();
|
||||
projectWizard.typeProjectNameOnWizard(projectName);
|
||||
projectWizard.selectSample(Wizard.SamplesName.WEB_JAVA_SPRING);
|
||||
selectSampleProject();
|
||||
projectWizard.clickCreateButton();
|
||||
loader.waitOnClosed();
|
||||
projectWizard.waitCloseProjectConfigForm();
|
||||
|
|
@ -90,4 +90,8 @@ public class CheckShowHideHiddenFilesTest {
|
|||
projectExplorer.waitItem(projectName);
|
||||
loader.waitOnClosed();
|
||||
}
|
||||
|
||||
protected void selectSampleProject() {
|
||||
projectWizard.selectSample(Wizard.SamplesName.WEB_JAVA_SPRING);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue