Skip to content

Selenium: cover workspace creation from Java stack by selenium test #10214

Merged
SkorikSergey merged 10 commits intomasterfrom
createWorskpaceFromJavaStack
Jul 3, 2018
Merged

Selenium: cover workspace creation from Java stack by selenium test #10214
SkorikSergey merged 10 commits intomasterfrom
createWorskpaceFromJavaStack

Conversation

@SkorikSergey
Copy link
Copy Markdown
Contributor

What does this PR do?

This PR creates CreateWorkspaceFromJavaStackTest selenium test that cover workspace creation from the Java stack.

What issues does this PR fix or reference?

#10050

Release Notes

Docs PR

@SkorikSergey SkorikSergey 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. team/che-qe labels Jun 27, 2018
@SkorikSergey SkorikSergey requested a review from vparfonov as a code owner June 27, 2018 13:00
waitExpectedTextIntoConsole(expectedMessageInTerminal, PREPARING_WS_TIMEOUT_SEC);
}

// Open web page by url and check visibility of web element on opened page
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Description of method is incomplete: it clicks on preview url.

}

// Open web page by url and check visibility of web element on opened page
public void startCommandAndCheckApp(String currentWindow, String webElementXpath) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like we can obtain currentWindow id inside the method.

seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability();
}

// Start command from project context menu and check expected message in Terminal
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Terminal > Console

}

// Start command from project context menu and check expected message in Terminal
public void startCommandAndCheckResult(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

startCommandAndCheckResult > executeCommandFromProjectExplorer

}

// Open web page by url and check visibility of web element on opened page
public void startCommandAndCheckApp(String currentWindow, String webElementXpath) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

startCommandAndCheckApp > checkWebElementVisibilityAtPreviewPage

}

// Open web page by url and check visibility of web element on opened page
public void startCommandAndCheckApp(String currentWindow, String webElementXpath) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

String webElementXpath > WebElement webElement looks more usable

.click();
}

public void startCommandFromProcessesArea(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

startCommandFromProcessesArea > executeCommandInsideProcessesArea

seleniumWebDriverHelper.waitAndClick(By.xpath(Locators.MAXIMIZE_BUTTON_XPATH));
}

// Wait for project has PROJECT_FOLDER status
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wait for project has PROJECT_FOLDER status > Wait project is completely initialized

import java.util.ArrayList;
import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces;

/** @author Skoryk Serhii */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to have some words about responsibility of class in JavaDocs

newWorkspace.clickOnCreateButtonAndOpenInIDE();
}

private void createWorkspace(NewWorkspace.Stack stack, String workspaceName) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

createWorkspace > prepareToClickOnCreateButton

private static final String CONSOLE_JAVA_SIMPLE = "console-java-simple";
private static final String WEB_JAVA_SPRING = "web-java-spring";

private ArrayList<String> projects = new ArrayList<>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it could be simplified as follow:
private List<String> projects = ImmutableList.of(CONSOLE_JAVA_SIMPLE, WEB_JAVA_SPRING);

WEB_JAVA_SPRING, RUN, "web-java-spring:run tomcat", "Server startup in");
consoles.startCommandAndCheckApp(currentWindow, "//span[text()='Enter your name: ']");

// start 'stop apache' command and check that apache not running
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Jun 27, 2018

Choose a reason for hiding this comment

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

start > execute
apache > Tomcat


// start 'stop apache' command and check that apache not running
projectExplorer.invokeCommandWithContextMenu(
RUN, WEB_JAVA_SPRING, "web-java-spring:stop tomcat");
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Jun 27, 2018

Choose a reason for hiding this comment

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

let's make constant with "web-java-spring:stop tomcat" command: STOP_TOMCAT_COMMAND_ITEM_NAME

@SkorikSergey
Copy link
Copy Markdown
Contributor Author

ci-test

@codenvy-ci
Copy link
Copy Markdown

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:10214
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

…kTest selenium tests to CheSuite.xml test suite
@SkorikSergey SkorikSergey merged commit 3066a81 into master Jul 3, 2018
@SkorikSergey SkorikSergey deleted the createWorskpaceFromJavaStack branch July 3, 2018 10:13
@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 Jul 3, 2018
@benoitf benoitf added this to the 6.8.0 milestone Jul 3, 2018
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.

4 participants