Skip to content

Selenium: Add new test method to the 'PullRequestPluginTest'#11128

Merged
dmytro-ndp merged 14 commits intomasterfrom
che#10000
Oct 1, 2018
Merged

Selenium: Add new test method to the 'PullRequestPluginTest'#11128
dmytro-ndp merged 14 commits intomasterfrom
che#10000

Conversation

@artaleks9
Copy link
Copy Markdown
Contributor

@artaleks9 artaleks9 commented Sep 9, 2018

What does this PR do?

  • Update the selenium test PullRequestPluginTest
    • add new test method createPullRequestToNonDefaultBranch() to the test class
    • rework the switchingBetweenProjects() test method
    • rework and rename the createPullRequest() test method
    • refactor code
  • Add the method 'clickRefreshContributionBranchButton()' to the PullRequestPanel
  • Add the id selector to the web element in the ContributePartViewImpl
  • Delete the 'try/catch' from the PullRequestPluginWithForkTest related to close the issue

What issues does this PR fix or reference?

#10000

@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 Sep 9, 2018
@artaleks9
Copy link
Copy Markdown
Contributor Author

ci-test

@riuvshin
Copy link
Copy Markdown
Contributor

riuvshin commented Sep 9, 2018

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

static final String PULL_REQUEST_BTN = "gwt-debug-partButton-Pull Request";
static final String BRANCH_NAME =
"//div[text()='Branch name:']/following-sibling::div//span/label[text()='%s']";
static final String REFRESH_BRANCH_BUTTON = "gwt-debug-refreshContributionBranchButton";
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Sep 10, 2018

Choose a reason for hiding this comment

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

Is it button name or id? Could you express it in the constant name to make it clear?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right.
Need to correct -> REFRESH_BRANCH_BUTTON_ID


/** Click 'refresh contribution branch name' button on the 'Pull Request' panel */
public void clickRefreshContributionBranchButton() {
seleniumWebDriverHelper.waitAndClick(refreshBranchListButton);
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.

refreshBranchListButton variable name hasn't completely agreed with button name expressed in method name refreshContributionBranchButton

private static final String NEW_BRANCH = generate("branch-", 8);
private static final String DEV_BRANCH_NAME = generate("dev-", 4);
private static final String BASE_BRANCH_NAME = generate("contrib-", 4);
private static final String NEW_BRANCH_NAME = generate("branch-", 8);
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Sep 10, 2018

Choose a reason for hiding this comment

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

NEW_BRANCH_NAME = generate("new-", 4); looks more suitable here

"%s wants to merge 1 commit into %s\n" + "from %s",
gitHubUsername, BASE_BRANCH_NAME, DEV_BRANCH_NAME);
seleniumWebDriverHelper.waitTextContains(
By.xpath("//div[@class='TableObject-item TableObject-item--primary']"), pullHeaderText);
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 name //div[@class='TableObject-item TableObject-item--primary'] somehow to understand it's propose.

pullRequestPanel.waitStatusOk(PULL_REQUEST_ISSUED);
pullRequestPanel.waitMessage(PULL_REQUEST_CREATED);

// check the pull header on the GitHub page
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Sep 10, 2018

Choose a reason for hiding this comment

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

it's not just pull header, but Pull Request header

@dmytro-ndp
Copy link
Copy Markdown
Contributor

IMHO checking pull request through the GitHub API by using is more reliably and safe method compare to getting to GitHub pull request web page and checking web elements state by it's xpath.
We could use org.kohsuke.github.GHRepository.getPullRequest() method for this propose.

@artaleks9
Copy link
Copy Markdown
Contributor Author

OK, it's a good idea

@dmytro-ndp dmytro-ndp changed the title Selenium: Add new test method to the 'PullRequestPlaginTest' Selenium: Add new test method to the 'PullRequestPluginTest' Sep 12, 2018
Dmytro Nochevnov added 2 commits September 21, 2018 19:31
@dmytro-ndp
Copy link
Copy Markdown
Contributor

ci-test

@riuvshin
Copy link
Copy Markdown
Contributor

Results of automated E2E tests of Eclipse Che Multiuser on OCP:
Build details
Test report
docker image: eclipseche/che-server:11128
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@dmytro-ndp
Copy link
Copy Markdown
Contributor

ci-test

@riuvshin
Copy link
Copy Markdown
Contributor

Results of automated E2E tests of Eclipse Che Multiuser on OCP:
Build details
Test report
docker image: eclipseche/che-server:11128
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

Dmytro Nochevnov added 2 commits September 24, 2018 13:28
Dmytro Nochevnov added 3 commits September 26, 2018 19:25
Signed-off-by: Dmytro Nochevnov <dnochevnov@codenvy.com>
Signed-off-by: Dmytro Nochevnov <dnochevnov@codenvy.com>
Signed-off-by: Dmytro Nochevnov <dnochevnov@codenvy.com>
@dmytro-ndp
Copy link
Copy Markdown
Contributor

ci-test

@riuvshin
Copy link
Copy Markdown
Contributor

Results of automated E2E tests of Eclipse Che Multiuser on OCP:
Build details
Test report
docker image: eclipseche/che-server:11128
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

Dmytro Nochevnov added 2 commits October 1, 2018 12:43
@dmytro-ndp
Copy link
Copy Markdown
Contributor

@artaleks9: please, review new changes.

@dmytro-ndp
Copy link
Copy Markdown
Contributor

ci-test

@artaleks9
Copy link
Copy Markdown
Contributor Author

Looks good for me

@riuvshin
Copy link
Copy Markdown
Contributor

riuvshin commented Oct 1, 2018

Results of automated E2E tests of Eclipse Che Multiuser on OCP:
Build details
Test report
docker image: eclipseche/che-server:11128
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

Signed-off-by: Dmytro Nochevnov <dnochevnov@codenvy.com>
@dmytro-ndp dmytro-ndp merged commit e5ca2e8 into master Oct 1, 2018
@dmytro-ndp dmytro-ndp deleted the che#10000 branch October 1, 2018 16:21
@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 Oct 1, 2018
@benoitf benoitf added this to the 6.12.0 milestone Oct 1, 2018
nickboldt pushed a commit to nickboldt/che that referenced this pull request Oct 3, 2018
…-che#11128)

* Add new test method 'createPullRequestToNonDefaultBranch' to the 'PullRequestPlaginTest'
* Add the method 'clickRefreshContributionBranchButton()' to the 'PullRequestPanel'
* Add the id selector to the web element in the 'ContributePartViewImpl'
* Delete the 'try/catch' from the 'PullRequestPluginWithForkTest' related to close the issue
* Read test pull request info by using kohsuke library
* Ensure 'Git Contribute' preference is set to default value after the test execution

Signed-off-by: Dmytro Nochevnov <dnochevnov@codenvy.com>
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.

7 participants