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: Rework the 'CheckoutReferenceTest' to run in the multi-thread mode #9368

Merged
merged 11 commits into from
Apr 11, 2018

Conversation

artaleks9
Copy link
Contributor

What does this PR do?

  • Rework the selenium test CheckoutReferenceTest to run in the multi-thread mode
  • Spit the test on the two test methods
  • Use the kohsuke Github library to avoid dependency from the test repository on GitHub
  • Move the CheckoutReferenceTest from the CheOneThreadTestsSuite to the CheSuite
  • Rework and methods to the TestGitHubRepository
  • Rework methods in the GitHistory page object using the SeleniumWebDriverHelper

What issues does this PR fix or reference?

#9139, #8153

@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 Apr 10, 2018
@artaleks9
Copy link
Contributor Author

ci-test

String hashCommit = sha1.substring(0, 8);
String wrongHashCommit = String.format("%s ##", hashCommit);
String failMessage = String.format("Branch name %s is not allowed", wrongHashCommit);
// import the test repo
Copy link
Contributor

Choose a reason for hiding this comment

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

missed empty line before comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right

*
* @param refName is a name of branch, tag, etc
* @param branchName is a name of new branch
Copy link
Contributor

Choose a reason for hiding this comment

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

@param branchName name of the branch which should be created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

/** Returns all cells from top row divided by "\n" */
private String getGitHistoryTopContent() {
String rowTopIndex = Integer.toString(0);
return seleniumWebDriverHelper
Copy link
Contributor

@dmytro-ndp dmytro-ndp Apr 10, 2018

Choose a reason for hiding this comment

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

There is a method SeleniumWebDriverHelper#waitVisibilityAndGetText() which is more suitable here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

GHRef master = ghRepo.getRef("heads/master");
return ghRepo.createRef("refs/heads/" + refName, master.getObject().getSha());
public GHRef createBranch(String branchName) throws IOException {
GHRef defaultBranch = ghRepo.getRef("heads/" + ghRepo.getDefaultBranch());
Copy link
Contributor

Choose a reason for hiding this comment

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

Please create public method which will be return the default branch

GHRef public getDefaultBranch(){
return ghRepo.getRef("heads/" + ghRepo.getDefaultBranch());
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Which test needs it?

Copy link
Contributor

@dmytro-ndp dmytro-ndp Apr 10, 2018

Choose a reason for hiding this comment

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

If there are actually no tests which need getDefaultBranch(), I would not create such method because we have already had ghRepo.getDefaultBranch().

Copy link
Contributor

Choose a reason for hiding this comment

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

He can create private method. Multiple using the same row

 GHRef defaultBranch = ghRepo.getRef("heads/" + ghRepo.getDefaultBranch());

looks not very good

Copy link
Contributor

Choose a reason for hiding this comment

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

Method name getReferenceToDefaultBranch() is more relevant to the returning value, IMHO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree

@codenvy-ci
Copy link

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

@artaleks9 artaleks9 merged commit 67403c0 into master Apr 11, 2018
@artaleks9 artaleks9 deleted the che#9139 branch April 11, 2018 10:17
@benoitf benoitf added this to the 6.4.0 milestone Apr 11, 2018
@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 Apr 11, 2018
This pull request was closed.
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