Skip to content

Selenium: Update the 'CreateFactoryTest' according to the test plan#10353

Merged
artaleks9 merged 8 commits intomasterfrom
che#9841
Jul 11, 2018
Merged

Selenium: Update the 'CreateFactoryTest' according to the test plan#10353
artaleks9 merged 8 commits intomasterfrom
che#9841

Conversation

@artaleks9
Copy link
Copy Markdown
Contributor

What does this PR do?

  • Rework and add test methods to the 'CreateFactoryTest' according to the test plan (https://docs.google.com/document/d/1HbU9rzto8wT-6CFE8GFPi3BEW60suVmSmxDkomqbxwQ/edit#heading=h.xa9oyfdrgazw)
  • Add and rework methods in the 'CreateFactoryPage' using the 'SeleniumWebDriverHelper'
  • Add and rework methods in the 'DashboardFactories'
  • Rework the 'selectResourceToUpload()' in the 'SeleniumWebDriverHelper' related to upload file to create factory on dashboard
  • Add the method 'getHttpsTransportUrl()' to the 'TestGitHubRepository'
  • Add the 'config-ws.json' file to the resources

What issues does this PR fix or reference?

#9841,#9785

@artaleks9 artaleks9 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 Jul 10, 2018
@artaleks9 artaleks9 requested a review from vparfonov as a code owner July 10, 2018 11:24
@artaleks9
Copy link
Copy Markdown
Contributor Author

ci-test


public void waitGitUrlField() {
redrawUiElementsTimeout.until(visibilityOfElementLocated(By.id(Locators.GIT_URL_ID)));
public void uploadSelectedConfigFile(Path resourcesUploadFile) throws IOException {
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's better to have short note about why we should use hiddenUploadInputButton instead of regular uploadFileButton to make the code clear.

searchWorkspaceField.sendKeys(text);
public void typeTextToSearchFactoryField(String expectedText) {
seleniumWebDriverHelper.setValue(searchWorkspaceField, expectedText);
WaitUtils.sleepQuietly(1);
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.

Can we avoid sleeping here?

private static final String MINIMAL_TEMPLATE_FACTORY_NAME = generate("factoryMin", 4);
private static final String COMPLETE_TEMPLATE_FACTORY_NAME = generate("factoryComplete", 4);
private static final String FACTORY_CREATED_FROM_WORKSPACE_NAME = generate("factoryWs", 4);
private static final String FACTORY_CREATED_FROM_GIT = generate("factoryGit-", 4);
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.

FACTORY_CREATED_FROM_GIT > FACTORY_CREATED_FROM_GIT_NAME?

private static final String COMPLETE_TEMPLATE_FACTORY_NAME = generate("factoryComplete", 4);
private static final String FACTORY_CREATED_FROM_WORKSPACE_NAME = generate("factoryWs", 4);
private static final String FACTORY_CREATED_FROM_GIT = generate("factoryGit-", 4);
private static final String FACTORY_CREATED_FROM_CONFIG = generate("factoryConfig", 4);
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.

FACTORY_CREATED_FROM_CONFIG > FACTORY_CREATED_FROM_CONFIG_NAME?

private static final String FACTORY_CREATED_FROM_WORKSPACE_NAME = generate("factoryWs", 4);
private static final String FACTORY_CREATED_FROM_GIT = generate("factoryGit-", 4);
private static final String FACTORY_CREATED_FROM_CONFIG = generate("factoryConfig", 4);
private static final String FACTORY_CREATED_FROM_USER_JSON = generate("factoryUser", 4);
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.

FACTORY_CREATED_FROM_USER_JSON > FACTORY_CREATED_FROM_USER_JSON_NAME?

workspaceServiceClient.delete(PROJECT_WS_NAME, defaultTestUser.getName());
workspaceServiceClient.delete(NO_PROJECT_WS_NAME, defaultTestUser.getName());

List<String> listFactory =
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.

listFactory > factoryList


@Test
public void shouldHandleIncorrectFactoryNames() {
public void checkHandlingOfNamesFactory() {
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.

checkHandlingOfNamesFactory > checkHandlingOfFactoryNames

}

@Test
public void checkEditorTemplateJson() throws Exception {
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.

checkEditorTemplateJson > checkEditorOfTemplateJson

}

@Test
public void shouldCreatingFactoryFromWorkspace() {
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.

shouldCreatingFactoryFromWorkspace > shouldCreateFactoryFromWorkspace

}
}
}
} No newline at end of file
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.

empty line at the end is missed

@riuvshin
Copy link
Copy Markdown
Contributor

ci-test

@eclipse-che eclipse-che deleted a comment from codenvy-ci Jul 10, 2018
return seleniumWebDriverHelper.waitVisibilityAndGetEnableState(uploadFileButton);
}

// we have to use the hidden web-element, because the file is uploaded when we send the command to
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.

IMHO it's important to explain why we can't use uploadFileButtn directly, like the follow:
// we can't use 'uploadFileButton' element directly here because it is a DIV which just calls hidden input of file type 'hiddenUploadInputButton'

@artaleks9
Copy link
Copy Markdown
Contributor Author

ci-test

@riuvshin
Copy link
Copy Markdown
Contributor

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

@artaleks9 artaleks9 merged commit 7d3393a into master Jul 11, 2018
@artaleks9 artaleks9 deleted the che#9841 branch July 11, 2018 07:29
@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 11, 2018
@benoitf benoitf added this to the 6.9.0 milestone Jul 11, 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.

5 participants