diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-04-03 17:56:23 +0200 |
---|---|---|
committer | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-04-13 12:21:37 +0200 |
commit | 139261bbc13192621ef795d6d45298e1d8e1b7f3 (patch) | |
tree | 7aa153b4b3fec7e8fbf3b3b4f5ed0a1a5cc69113 /it/it-tests/src/test | |
parent | d665528c8751ead9ca93e3d18dd8600fac92834b (diff) | |
download | sonarqube-139261bbc13192621ef795d6d45298e1d8e1b7f3.tar.gz sonarqube-139261bbc13192621ef795d6d45298e1d8e1b7f3.zip |
SONAR-9064 Rework facets sidebar on the issues page
Diffstat (limited to 'it/it-tests/src/test')
6 files changed, 9 insertions, 209 deletions
diff --git a/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java b/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java index 94059da5a26..ee865958c23 100644 --- a/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java @@ -156,14 +156,14 @@ public class IssueNotificationsTest extends AbstractIssueTest { assertThat((String) message.getContent()).contains("Severity"); assertThat((String) message.getContent()).contains("One Issue Per Line (xoo): 17"); assertThat((String) message.getContent()).contains( - "See it in SonarQube: http://localhost:9000/component_issues?id=sample#createdAt=2015-12-15T00%3A00%3A00%2B"); + "See it in SonarQube: http://localhost:9000/project/issues?id=sample&createdAt=2015-12-15T00%3A00%3A00%2B"); assertThat(emails.hasNext()).isTrue(); message = emails.next().getMimeMessage(); assertThat(message.getHeader("To", null)).isEqualTo("<tester@example.org>"); assertThat((String) message.getContent()).contains("sample/Sample.xoo"); assertThat((String) message.getContent()).contains("Assignee changed to Tester"); - assertThat((String) message.getContent()).contains("See it in SonarQube: http://localhost:9000/issues/search#issues=" + issue.key()); + assertThat((String) message.getContent()).contains("See it in SonarQube: http://localhost:9000/issues?issues=" + issue.key()); assertThat(emails.hasNext()).isFalse(); } @@ -218,7 +218,7 @@ public class IssueNotificationsTest extends AbstractIssueTest { assertThat((String) message.getContent()).contains("sample/Sample.xoo"); assertThat((String) message.getContent()).contains("Severity: BLOCKER (was MINOR)"); assertThat((String) message.getContent()).contains( - "See it in SonarQube: http://localhost:9000/issues/search#issues=" + issue.key()); + "See it in SonarQube: http://localhost:9000/issues?issues=" + issue.key()); assertThat(emails.hasNext()).isFalse(); } diff --git a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java index de638136033..5c4007cf222 100644 --- a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java +++ b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java @@ -28,7 +28,6 @@ import org.apache.commons.lang.time.DateUtils; import org.assertj.core.api.Fail; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.sonar.wsclient.base.HttpException; import org.sonar.wsclient.base.Paging; @@ -50,7 +49,6 @@ import static util.ItUtils.runProjectAnalysis; import static util.ItUtils.setServerProperty; import static util.ItUtils.toDate; import static util.ItUtils.verifyHttpException; -import static util.selenium.Selenese.runSelenese; public class IssueSearchTest extends AbstractIssueTest { @@ -273,17 +271,6 @@ public class IssueSearchTest extends AbstractIssueTest { assertThat(issues.component(issue).projectId()).isEqualTo(project.id()); } - /** - * SONAR-5659 - */ - @Test - @Ignore("unstable") - public void redirect_to_search_url_after_wrong_login() { - // Force user authentication to check login on the issues search page - setServerProperty(ORCHESTRATOR, "sonar.forceAuthentication", "true"); - runSelenese(ORCHESTRATOR, "/issue/IssueSearchTest/redirect_to_search_url_after_wrong_login.html"); - } - @Test public void return_issue_type() throws Exception { List<org.sonarqube.ws.Issues.Issue> issues = searchByRuleKey("xoo:OneBugIssuePerLine"); @@ -309,11 +296,6 @@ public class IssueSearchTest extends AbstractIssueTest { assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("VULNERABILITY"))).getPaging().getTotal()).isEqualTo(8); } - @Test - public void bulk_change() { - runSelenese(ORCHESTRATOR, "/issue/IssueSearchTest/bulk_change.html"); - } - private List<org.sonarqube.ws.Issues.Issue> searchByRuleKey(String... ruleKey) throws IOException { return searchIssues(new SearchWsRequest().setRules(asList(ruleKey))).getIssuesList(); } diff --git a/it/it-tests/src/test/java/it/ui/UiTest.java b/it/it-tests/src/test/java/it/ui/UiTest.java index 4c789853776..b75534fd12f 100644 --- a/it/it-tests/src/test/java/it/ui/UiTest.java +++ b/it/it-tests/src/test/java/it/ui/UiTest.java @@ -87,14 +87,14 @@ public class UiTest { $(".overview-quality-gate") .shouldBe(visible) .shouldHave(text("Passed")); - $("a[href=\"/component_issues?id=sample#resolved=false|types=CODE_SMELL\"]") + $("a[href=\"/project/issues?id=sample&resolved=false&types=CODE_SMELL\"]") .shouldBe(visible) .shouldHave(text("0")) .click(); // on project issues page - assertThat(url()).contains("/component_issues?id=sample#resolved=false|types=CODE_SMELL"); - $(".facet.active[data-unresolved]").shouldBe(visible); + assertThat(url()).contains("/project/issues?id=sample&resolved=false&types=CODE_SMELL"); + $("[data-property=\"resolutions\"] .facet.active").shouldBe(visible); $("#global-navigation").find("a[href=\"/profiles\"]").click(); diff --git a/it/it-tests/src/test/java/pageobjects/issues/IssuesPage.java b/it/it-tests/src/test/java/pageobjects/issues/IssuesPage.java index 801c24a9b0b..33972cc2823 100644 --- a/it/it-tests/src/test/java/pageobjects/issues/IssuesPage.java +++ b/it/it-tests/src/test/java/pageobjects/issues/IssuesPage.java @@ -19,9 +19,7 @@ */ package pageobjects.issues; -import com.codeborne.selenide.CollectionCondition; import com.codeborne.selenide.ElementsCollection; -import com.codeborne.selenide.SelenideElement; import java.util.List; import java.util.stream.Collectors; @@ -55,23 +53,14 @@ public class IssuesPage { public IssuesPage bulkChangeOpen() { $("#issues-bulk-change").shouldBe(visible).click(); - $("a.js-bulk-change").click(); $("#bulk-change-form").shouldBe(visible); return this; } public IssuesPage bulkChangeAssigneeSearchCount(String query, Integer count) { - if (!$(".select2-drop-active").isDisplayed()) { - $("#bulk-change-form #s2id_assignee").shouldBe(visible).click(); - } - SelenideElement input = $(".select2-drop-active input").shouldBe(visible); - input.val("").sendKeys(query); - if (count > 0) { - $(".select2-drop-active .select2-results li.select2-result").shouldBe(visible); - } else { - $(".select2-drop-active .select2-results li.select2-no-results").shouldBe(visible); - } - $$(".select2-drop-active .select2-results li.select2-result").shouldHaveSize(count); + $("#issues-bulk-change-assignee .Select-input input").val(query); + $$("#issues-bulk-change-assignee .Select-option").shouldHaveSize(count); + $("#issues-bulk-change-assignee .Select-input input").pressEscape(); return this; } } diff --git a/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html b/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html deleted file mode 100644 index c390c02d105..00000000000 --- a/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<tbody> -<tr> - <td>open</td> - <td>/sessions/logout</td> - <td></td> -</tr> -<tr> - <td>open</td> - <td>/sessions/new</td> - <td></td> -</tr> -<tr> - <td>waitForText</td> - <td>content</td> - <td>*Log In to SonarQube*</td> -</tr> -<tr> - <td>type</td> - <td>id=login</td> - <td>admin</td> -</tr> -<tr> - <td>type</td> - <td>id=password</td> - <td>admin</td> -</tr> -<tr> - <td>clickAndWait</td> - <td>commit</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>css=.js-user-authenticated</td> - <td></td> -</tr> -<tr> - <td>open</td> - <td>/issues</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>css=.search-navigator-workspace-list .issue</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>id=issues-bulk-change</td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>id=issues-bulk-change</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>css=#issues-bulk-change + .dropdown-menu .js-bulk-change</td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>css=#issues-bulk-change + .dropdown-menu .js-bulk-change</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>id=bulk-change-form</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>id=transition-confirm</td> - <td></td> -</tr> -</tbody> -</table> -</body> -</html> diff --git a/it/it-tests/src/test/resources/issue/IssueSearchTest/redirect_to_search_url_after_wrong_login.html b/it/it-tests/src/test/resources/issue/IssueSearchTest/redirect_to_search_url_after_wrong_login.html deleted file mode 100644 index 791967ed6ea..00000000000 --- a/it/it-tests/src/test/resources/issue/IssueSearchTest/redirect_to_search_url_after_wrong_login.html +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> - <tbody> - <tr> - <td>open</td> - <td>/sessions/logout</td> - <td></td> - </tr> - <tr> - <td>open</td> - <td>/issues#resolved=true|statuses=OPEN</td> - <td></td> - </tr> - <tr> - <td>waitForText</td> - <td>content</td> - <td>*Log In to SonarQube*</td> - </tr> - <tr> - <td>waitForElementPresent</td> - <td>id=login</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>id=password</td> - <td>wrongpassword</td> - </tr> - <tr> - <td>type</td> - <td>id=login</td> - <td>wronglogin</td> - </tr> - <tr> - <td>type</td> - <td>id=password</td> - <td>wrongpassword</td> - </tr> - <tr> - <td>clickAndWait</td> - <td>commit</td> - <td></td> - </tr> - <tr> - <td>waitForText</td> - <td>css=.alert</td> - <td>*Authentication failed*</td> - </tr> - <tr> - <td>waitForElementPresent</td> - <td>id=login</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>id=login</td> - <td>admin</td> - </tr> - <tr> - <td>type</td> - <td>id=password</td> - <td>admin</td> - </tr> - <tr> - <td>clickAndWait</td> - <td>commit</td> - <td></td> - </tr> - <tr> - <td>assertLocation</td> - <td>*#resolved=true|statuses=OPEN*</td> - <td></td> - </tr> - </tbody> -</table> -</body> -</html> |