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: Fix unexpected fail of CheckAutocompleteFeaturesInTheTestFolderTest selenium test #8457

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public interface FileWatcherExcludeOperations {

protected interface Locators {
String PROJECT_EXPLORER_TREE_ITEMS = "gwt-debug-projectTree";
String EXPLORER_RIGHT_TAB_ID = "gwt-debug-partButton-Explorer";
String EXPLORER_RIGHT_TAB_ID = "gwt-debug-partButton-Projects";
String CONTEXT_MENU_ID = "gwt-debug-contextMenu/newGroup";
String GO_BACK_BUTTON = "gwt-debug-goBackButton";
String COLLAPSE_ALL_BUTTON = "gwt-debug-collapseAllButton";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
import java.net.URL;
import java.nio.file.Paths;
import org.eclipse.che.commons.lang.NameGenerator;
import org.eclipse.che.selenium.core.client.TestCommandServiceClient;
import org.eclipse.che.selenium.core.client.TestProjectServiceClient;
import org.eclipse.che.selenium.core.constant.TestBuildConstants;
import org.eclipse.che.selenium.core.constant.TestCommandsConstants;
import org.eclipse.che.selenium.core.project.ProjectTemplates;
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
import org.eclipse.che.selenium.pageobject.CodenvyEditor;
import org.eclipse.che.selenium.pageobject.Consoles;
import org.eclipse.che.selenium.pageobject.Ide;
import org.eclipse.che.selenium.pageobject.Loader;
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
import org.eclipse.che.selenium.pageobject.intelligent.CommandsEditor;
import org.eclipse.che.selenium.pageobject.intelligent.CommandsExplorer;
import org.eclipse.che.selenium.pageobject.intelligent.CommandsToolbar;
import org.openqa.selenium.Keys;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Expand All @@ -35,6 +42,8 @@ public class CheckAutocompleteFeaturesInTheTestFolderTest {
private static final String PROJECT_NAME =
NameGenerator.generate("CheckAuthoCompleteInTheTestFolder_", 4);
private static final String tesClass = "AppTest.java";
private static final String BUILD_COMMAND = "mvn clean install -f ${current.project.path}";
private static final String BUILD_COMMAND_NAME = "build";
private final String pathToClassInTstFolder =
PROJECT_NAME + "/src/test/java/com/codenvy/example/java/";

Expand All @@ -44,6 +53,11 @@ public class CheckAutocompleteFeaturesInTheTestFolderTest {
@Inject private Loader loader;
@Inject private CodenvyEditor editor;
@Inject private TestProjectServiceClient testProjectServiceClient;
@Inject private TestCommandServiceClient testCommandServiceClient;
@Inject private CommandsToolbar commandsToolbar;
@Inject private Consoles consoles;
@Inject private CommandsExplorer commandsExplorer;
@Inject private CommandsEditor commandsEditor;

@BeforeClass
public void prepare() throws Exception {
Expand All @@ -53,12 +67,27 @@ public void prepare() throws Exception {
Paths.get(resource.toURI()),
PROJECT_NAME,
ProjectTemplates.MAVEN_SPRING);

testCommandServiceClient.createCommand(
BUILD_COMMAND, BUILD_COMMAND_NAME, TestCommandsConstants.MAVEN, workspace.getId());

ide.open(workspace);
}

@Test
public void checkAutocompleteFeaturesInTheTestFolderTest() {
projectExplorer.waitProjectExplorer();
projectExplorer.waitItem(PROJECT_NAME);

commandsExplorer.openCommandsExplorer();
commandsExplorer.waitCommandExplorerIsOpened();
commandsExplorer.runCommandByName(BUILD_COMMAND_NAME);
consoles.waitExpectedTextIntoConsole(TestBuildConstants.BUILD_SUCCESS);

projectExplorer.clickOnProjectExplorerTab();
projectExplorer.waitProjectExplorer();
projectExplorer.waitItem(PROJECT_NAME);

projectExplorer.quickExpandWithJavaScript();
loader.waitOnClosed();
projectExplorer.openItemByPath(pathToClassInTstFolder + tesClass);
Expand Down