Selenium: cover workspace creation from CentOS stacks by selenium tests#10255
Selenium: cover workspace creation from CentOS stacks by selenium tests#10255SkorikSergey merged 16 commits intomasterfrom
Conversation
|
ci-test |
|
ci-test build report: |
|
ci-test |
|
ci-test build report: |
|
ci-test |
|
ci-test build report: |
| public static final String BUILD_FAILED = "[INFO] BUILD FAILURE"; | ||
| public static final String SERVER_STARTUP_IN = "Server startup in"; | ||
| public static final String LISTENING_AT_ADDRESS = "Listening for transport dt_socket at address"; | ||
| public static final String LISTENING_AT_ADDRESS_8000 = |
There was a problem hiding this comment.
We can simplify it as follow:
LISTENING_AT_ADDRESS_8000 = LISTENING_AT_ADDRESS + ": 8000";
| String machineName, | ||
| ContextMenuCommandGoals commandGoal, | ||
| String commandName, | ||
| String expectedMessageInTerminal) { |
There was a problem hiding this comment.
Console or Terminal? Consistent names make the code clearer.
| return switchToIdeAndWaitWorkspaceIsReadyToUse(APPLICATION_START_TIMEOUT_SEC); | ||
| } | ||
|
|
||
| public String switchToIdeAndWaitWorkspaceIsReadyToUse(int timeout) { |
There was a problem hiding this comment.
timeoutInSec name helps to understand metric of variable.
| } | ||
|
|
||
| @Test(priority = 1) | ||
| public void checkDesktopGoSimpleProjectCommandsStack() { |
There was a problem hiding this comment.
Too complex name IMHO. It would be better to have it rewrote with "of".
| } | ||
|
|
||
| @Test(priority = 1) | ||
| public void checkWebGoSimpleProjectCommandsStack() { |
There was a problem hiding this comment.
Too complex name IMHO. It would be better to have it rewrote with "of".
| RUN_GOAL, | ||
| BUILD_AND_RUN_COMMAND_ITEM.getItem(WEB_JAVA_SPRING), | ||
| SERVER_STARTUP_IN); | ||
| consoles.checkWebElementVisibilityAtPreviewPage(By.xpath("//span[text()='Enter your name: ']")); |
There was a problem hiding this comment.
Define "//span[text()='Enter your name: ']" string as a constant will make the code clear, IMHO, and will allow to avoid duplication.
| consoles.selectProcessInProcessConsoleTreeByName("Terminal"); | ||
| terminal.typeIntoTerminal("ps ax"); | ||
| terminal.typeIntoTerminal(ENTER.toString()); | ||
| terminal.waitExpectedTextNotPresentTerminal("/bin/bash -c $TOMCAT_HOME/bin/catalina.sh"); |
There was a problem hiding this comment.
It's not quite clear what "/bin/bash -c $TOMCAT_HOME/bin/catalina.sh" is about. From this point it would be better to name the string.
| public class CreateWorkspaceFromJavaMySqlCentosStackTest { | ||
|
|
||
| private static final String WORKSPACE_NAME = generate("workspace", 4); | ||
| private static final String WEB_JAVA_PETCLINIC = "web-java-petclinic"; |
There was a problem hiding this comment.
If web-java-petclinic is the name of project, let's name the constant WEB_JAVA_PROJECT.
| public void checkWebJavaPetclinicProjectCommands() { | ||
| projectExplorer.openItemByPath(WEB_JAVA_PETCLINIC); | ||
|
|
||
| consoles.executeCommandFromProcessesArea( |
There was a problem hiding this comment.
It's not quite clear what next sequence of command is doing exactly. Could you, please, comment it in the code?
| "db", COMMON_GOAL, "show databases", "information_schema"); | ||
|
|
||
| consoles.executeCommandFromProcessesArea( | ||
| "dev-machine", COMMON_GOAL, BUILD_COMMAND, BUILD_SUCCESS); |
There was a problem hiding this comment.
Defining "dev-machine" string as a constant will make the code clear, IMHO, and will allow to avoid duplication.
| consoles.selectProcessInProcessConsoleTreeByName("Terminal"); | ||
| terminal.typeIntoTerminal("ps ax"); | ||
| terminal.typeIntoTerminal(ENTER.toString()); | ||
| terminal.waitExpectedTextNotPresentTerminal("$TOMCAT_HOME/bin/catalina.sh"); |
There was a problem hiding this comment.
It's not quite clear what "$TOMCAT_HOME/bin/catalina.sh" is about. From this point it would be better to name the string.
| RUN_GOAL, | ||
| BUILD_AND_DEPLOY_COMMAND_ITEM.getItem(WEB_JAVA_PETCLINIC), | ||
| "Server startup in"); | ||
| consoles.checkWebElementVisibilityAtPreviewPage(By.xpath("//h2[text()='Welcome']")); |
There was a problem hiding this comment.
It's not quite clear what "//h2[text()='Welcome']" is about. From this point it would be better to name the string.
| STOP_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_PETCLINIC), | ||
| "dev-machine"); | ||
| consoles.selectProcessInProcessConsoleTreeByName("Terminal"); | ||
| terminal.typeIntoTerminal("ps ax"); |
There was a problem hiding this comment.
It's not quite clear what "ps ax" is about. From this point it would be better to name the string.
| public class CreateWorkspaceFromJavaStackTest { | ||
|
|
||
| private static final String WORKSPACE_NAME = generate("workspace", 4); | ||
| private static final String CONSOLE_JAVA_SIMPLE = "console-java-simple"; |
There was a problem hiding this comment.
If console-java-simple is the name of project, let's name the constant CONSOLE_JAVA_PROJECT.
|
|
||
| private static final String WORKSPACE_NAME = generate("workspace", 4); | ||
| private static final String CONSOLE_JAVA_SIMPLE = "console-java-simple"; | ||
| private static final String WEB_JAVA_SPRING = "web-java-spring"; |
There was a problem hiding this comment.
If web-java-spring is the name of project, let's name the constant WEB_JAVA_SPRING_PROJECT.
| public class CreateWorkspaceFromSpringBootStackTest { | ||
|
|
||
| private static final String WORKSPACE_NAME = generate("workspace", 4); | ||
| private static final String SPRING_BOOT_HEALTH_CHECK_BOOSTER = "spring-boot-health-check-booster"; |
There was a problem hiding this comment.
SPRING_BOOT_HEALTH_CHECK_PROJECT?
|
|
||
| private static final String WORKSPACE_NAME = generate("workspace", 4); | ||
| private static final String SPRING_BOOT_HEALTH_CHECK_BOOSTER = "spring-boot-health-check-booster"; | ||
| private static final String SPRING_BOOT_HTTP_BOOSTER = "spring-boot-http-booster"; |
There was a problem hiding this comment.
SPRING_BOOT_HTTP_PROJECT?
| createWorkspaceHelper.createWorkspaceFromStackWithProjects( | ||
| SPRING_BOOT, WORKSPACE_NAME, projects); | ||
|
|
||
| ide.switchToIdeAndWaitWorkspaceIsReadyToUse(PREPARING_WS_TIMEOUT_SEC * 2); |
There was a problem hiding this comment.
It's better to comment on the * 2 why it's needed here.
|
|
||
| @Test(priority = 1) | ||
| public void checkSpringBootHealthCheckBoosterProjectCommands() { | ||
| consoles.executeCommandFromProjectExplorer( |
There was a problem hiding this comment.
It's not quite clear what next sequence of command is doing exactly. Could you, please, comment it in the code?
| consoles.executeCommandFromProjectExplorer( | ||
| SPRING_BOOT_HEALTH_CHECK_BOOSTER, RUN_GOAL, RUN_COMMAND, "Started BoosterApplication in"); | ||
| consoles.checkWebElementVisibilityAtPreviewPage( | ||
| By.xpath("//h2[text()='Health Check Booster']")); |
There was a problem hiding this comment.
Defining "//h2[text()='Health Check Booster']" string as a constant will make the code clear, IMHO, and will allow to avoid duplication.
|
|
||
| @Test(priority = 1) | ||
| public void checkSpringBooHttpBoosterProjectCommands() { | ||
| consoles.executeCommandFromProjectExplorer( |
There was a problem hiding this comment.
It's not quite clear what next sequence of command is doing exactly. Could you, please, comment it in the code?
|
ci-build |
|
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/4574/ |
What does this PR do?
This PR creates selenium tests that cover workspace creation from next CentOS stacks:
What issues does this PR fix or reference?
#10250, #10050
Release Notes
Docs PR