]> source.dussan.org Git - sonarqube.git/commitdiff
Move action plan ITs
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 3 Nov 2015 10:20:30 +0000 (11:20 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 3 Nov 2015 13:20:31 +0000 (14:20 +0100)
it/it-tests/src/test/java/it/Category1Suite.java
it/it-tests/src/test/java/it/actionPlan/ActionPlanTest.java [new file with mode: 0644]
it/it-tests/src/test/java/it/actionPlan/ActionPlanUiTest.java [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/can_create_action_plan_with_date_today.html [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_date_in_past.html [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_invalid_date.html [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_two_action_plans_with_same_name.html [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/close_and_reopen_action_plan.html [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/create_and_delete_action_plan.html [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/edit_action_plan.html [new file with mode: 0644]
it/it-tests/src/test/resources/actionPlan/one-issue-per-line-profile.xml [new file with mode: 0644]

index 6cb1b658a8ae841c5eafc1133823f225271101ab..69598fb08997e1375b29ea265054b4ebc4a07bf0 100644 (file)
@@ -39,6 +39,8 @@ package it;/*
  */
 
 import com.sonar.orchestrator.Orchestrator;
+import it.actionPlan.ActionPlanTest;
+import it.actionPlan.ActionPlanUiTest;
 import it.authorisation.IssuePermissionTest;
 import it.i18n.I18nTest;
 import it.measureHistory.DifferentialPeriodsTest;
@@ -87,7 +89,10 @@ import static util.ItUtils.xooPlugin;
   SincePreviousVersionHistoryTest.class,
   SinceXDaysHistoryTest.class,
   TimeMachineTest.class,
-  TimeMachineUiTest.class
+  TimeMachineUiTest.class,
+  // action plan
+  ActionPlanTest.class,
+  ActionPlanUiTest.class
 })
 public class Category1Suite {
 
diff --git a/it/it-tests/src/test/java/it/actionPlan/ActionPlanTest.java b/it/it-tests/src/test/java/it/actionPlan/ActionPlanTest.java
new file mode 100644 (file)
index 0000000..1fc446b
--- /dev/null
@@ -0,0 +1,290 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package it.actionPlan;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.locator.FileLocation;
+import it.Category1Suite;
+import java.util.List;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.sonar.wsclient.SonarClient;
+import org.sonar.wsclient.base.HttpException;
+import org.sonar.wsclient.issue.ActionPlan;
+import org.sonar.wsclient.issue.ActionPlanClient;
+import org.sonar.wsclient.issue.Issue;
+import org.sonar.wsclient.issue.IssueClient;
+import org.sonar.wsclient.issue.IssueQuery;
+import org.sonar.wsclient.issue.Issues;
+import org.sonar.wsclient.issue.NewActionPlan;
+import org.sonar.wsclient.issue.UpdateActionPlan;
+import org.sonar.wsclient.user.UserParameters;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+import static util.ItUtils.runProjectAnalysis;
+import static util.ItUtils.toDate;
+import static util.ItUtils.verifyHttpException;
+
+public class ActionPlanTest {
+
+  @ClassRule
+  public static final Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
+  private static final String PROJECT_KEY = "sample";
+
+  @BeforeClass
+  public static void analyzeProject() {
+    orchestrator.resetData();
+
+    orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/actionPlan/one-issue-per-line-profile.xml"));
+    orchestrator.getServer().provisionProject("sample", "Sample");
+    orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-issue-per-line-profile");
+    runProjectAnalysis(orchestrator, "shared/xoo-sample");
+  }
+
+  protected static ActionPlanClient adminActionPlanClient() {
+    return orchestrator.getServer().adminWsClient().actionPlanClient();
+  }
+
+  protected static ActionPlanClient actionPlanClient() {
+    return orchestrator.getServer().wsClient().actionPlanClient();
+  }
+
+  protected static ActionPlan firstActionPlan(String projectKey) {
+    List<ActionPlan> actionPlans = actionPlanClient().find(projectKey);
+    assertThat(actionPlans).hasSize(1);
+    return actionPlans.get(0);
+  }
+
+  protected static IssueClient adminIssueClient() {
+    return orchestrator.getServer().adminWsClient().issueClient();
+  }
+
+  protected static Issue searchRandomIssue() {
+    List<Issue> issues = search(IssueQuery.create()).list();
+    assertThat(issues).isNotEmpty();
+    return issues.get(0);
+  }
+
+  protected static Issues search(IssueQuery issueQuery) {
+    return issueClient().find(issueQuery);
+  }
+
+  protected static IssueClient issueClient() {
+    return orchestrator.getServer().wsClient().issueClient();
+  }
+
+  @Before
+  public void resetData() {
+    // TODO should be done by a WS
+    orchestrator.getDatabase().truncate("action_plans");
+    assertThat(adminActionPlanClient().find(PROJECT_KEY)).isEmpty();
+  }
+
+  @Test
+  public void create_action_plan() {
+    assertThat(adminActionPlanClient().find(PROJECT_KEY)).isEmpty();
+
+    ActionPlan newActionPlan = adminActionPlanClient().create(
+      NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+    assertThat(newActionPlan.key()).isNotNull();
+
+    ActionPlan actionPlan = firstActionPlan(PROJECT_KEY);
+    assertThat(actionPlan.name()).isEqualTo("Short term");
+    assertThat(actionPlan.description()).isEqualTo("Short term issues");
+    assertThat(actionPlan.status()).isEqualTo("OPEN");
+    assertThat(actionPlan.project()).isEqualTo(PROJECT_KEY);
+    assertThat(actionPlan.deadLine()).isNotNull();
+    assertThat(actionPlan.createdAt()).isNotNull();
+    assertThat(actionPlan.updatedAt()).isNotNull();
+    assertThat(actionPlan.totalIssues()).isEqualTo(0);
+    assertThat(actionPlan.unresolvedIssues()).isEqualTo(0);
+  }
+
+  /**
+   * SONAR-5179
+   */
+  @Test
+  public void need_project_administrator_permission_to_create_action_plan() {
+    String projectAdminUser = "with-admin-permission-on-project";
+    String projectUser = "with-user-permission-on-project";
+    SonarClient adminClient = orchestrator.getServer().adminWsClient();
+    try {
+      // Create a user having admin permission on the project
+      adminClient.userClient().create(UserParameters.create().login(projectAdminUser).name(projectAdminUser).password("password").passwordConfirmation("password"));
+      orchestrator.getServer().adminWsClient().post("api/permissions/add_user",
+        "login", projectAdminUser,
+        "projectKey", PROJECT_KEY,
+        "permission", "admin");
+
+      // Create a user having browse permission on the project
+      adminClient.userClient().create(UserParameters.create().login(projectUser).name(projectUser).password("password").passwordConfirmation("password"));
+      orchestrator.getServer().adminWsClient().post("api/permissions/add_user",
+        "login", projectUser,
+        "projectKey", PROJECT_KEY,
+        "permission", "user");
+
+      // Without project admin permission, a user cannot set action plan
+      try {
+        orchestrator.getServer().wsClient(projectUser, "password").actionPlanClient().create(
+          NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues"));
+        fail();
+      } catch (Exception e) {
+        assertThat(e).isInstanceOf(HttpException.class).describedAs("404");
+      }
+
+      // With project admin permission, a user can set action plan
+      orchestrator.getServer().wsClient(projectAdminUser, "password").actionPlanClient().create(
+        NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues"));
+      assertThat(actionPlanClient().find(PROJECT_KEY)).hasSize(1);
+
+    } finally {
+      adminClient.userClient().deactivate(projectAdminUser);
+      adminClient.userClient().deactivate(projectUser);
+    }
+  }
+
+  @Test
+  public void fail_create_action_plan_if_missing_project() {
+    try {
+      adminActionPlanClient().create(NewActionPlan.create().name("Short term")
+        .description("Short term issues").deadLine(toDate("2113-01-31")));
+      fail();
+    } catch (Exception e) {
+      verifyHttpException(e, 400);
+    }
+  }
+
+  @Test
+  public void fail_create_action_plan_if_missing_name() {
+    try {
+      adminActionPlanClient().create(NewActionPlan.create().project(PROJECT_KEY)
+        .description("Short term issues").deadLine(toDate("2113-01-31")));
+      fail();
+    } catch (Exception e) {
+      verifyHttpException(e, 400);
+    }
+  }
+
+  @Test
+  public void update_action_plan() {
+    ActionPlan newActionPlan = adminActionPlanClient().create(
+      NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+
+    ActionPlan updatedActionPlan = adminActionPlanClient().update(
+      UpdateActionPlan.create().key(newActionPlan.key()).name("Long term").description("Long term issues").deadLine(toDate("2114-12-01")));
+    assertThat(updatedActionPlan).isNotNull();
+
+    ActionPlan actionPlan = firstActionPlan(PROJECT_KEY);
+    assertThat(actionPlan.name()).isEqualTo("Long term");
+    assertThat(actionPlan.description()).isEqualTo("Long term issues");
+    assertThat(actionPlan.project()).isEqualTo(PROJECT_KEY);
+    assertThat(actionPlan.deadLine()).isNotNull();
+    assertThat(actionPlan.deadLine()).isNotEqualTo(newActionPlan.deadLine());
+    assertThat(actionPlan.updatedAt()).isNotNull();
+  }
+
+  @Test
+  public void fail_update_action_plan_if_missing_name() {
+    try {
+      adminActionPlanClient().create(
+        NewActionPlan.create().project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+      fail();
+    } catch (Exception e) {
+      verifyHttpException(e, 400);
+    }
+  }
+
+  @Test
+  public void delete_action_plan() {
+    ActionPlan newActionPlan = adminActionPlanClient().create(
+      NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+
+    adminActionPlanClient().delete(newActionPlan.key());
+
+    List<ActionPlan> results = adminActionPlanClient().find(PROJECT_KEY);
+    assertThat(results).isEmpty();
+  }
+
+  /**
+   * SONAR-4449
+   */
+  @Test
+  public void delete_action_plan_also_unplan_linked_issues() {
+    // Create action plan
+    ActionPlan newActionPlan = adminActionPlanClient().create(
+      NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+
+    Issue issue = searchRandomIssue();
+    // Link an issue to the action plan
+    adminIssueClient().plan(issue.key(), newActionPlan.key());
+    // Delete action plan
+    adminActionPlanClient().delete(newActionPlan.key());
+
+    // Reload the issue
+    Issue reloaded = searchIssueByKey(issue.key());
+    assertThat(reloaded.actionPlan()).isNull();
+  }
+
+  @Test
+  public void close_action_plan() {
+    ActionPlan newActionPlan = adminActionPlanClient().create(
+      NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+    assertThat(firstActionPlan(PROJECT_KEY).status()).isEqualTo("OPEN");
+
+    adminActionPlanClient().close(newActionPlan.key());
+
+    ActionPlan actionPlan = firstActionPlan(PROJECT_KEY);
+    assertThat(actionPlan.status()).isEqualTo("CLOSED");
+  }
+
+  @Test
+  public void open_action_plan() {
+    ActionPlan newActionPlan = adminActionPlanClient().create(
+      NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+
+    adminActionPlanClient().close(newActionPlan.key());
+    adminActionPlanClient().open(newActionPlan.key());
+
+    ActionPlan actionPlan = firstActionPlan(PROJECT_KEY);
+    assertThat(actionPlan.status()).isEqualTo("OPEN");
+  }
+
+  @Test
+  public void find_action_plans() {
+    assertThat(actionPlanClient().find(PROJECT_KEY)).isEmpty();
+
+    adminActionPlanClient().create(NewActionPlan.create().name("Short term").project(PROJECT_KEY).description("Short term issues").deadLine(toDate("2113-01-31")));
+    adminActionPlanClient().create(NewActionPlan.create().name("Long term").project(PROJECT_KEY).description("Long term issues"));
+
+    assertThat(actionPlanClient().find(PROJECT_KEY)).hasSize(2);
+  }
+
+  protected Issue searchIssueByKey(String issueKey) {
+    IssueQuery query = IssueQuery.create().issues(issueKey);
+    query.urlParams().put("additionalFields", "_all");
+    List<Issue> issues = search(query).list();
+    assertThat(issues).hasSize(1);
+    return issues.get(0);
+  }
+
+}
diff --git a/it/it-tests/src/test/java/it/actionPlan/ActionPlanUiTest.java b/it/it-tests/src/test/java/it/actionPlan/ActionPlanUiTest.java
new file mode 100644 (file)
index 0000000..1537f0e
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+package it.actionPlan;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.locator.FileLocation;
+import com.sonar.orchestrator.selenium.Selenese;
+import it.Category1Suite;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.sonar.wsclient.issue.ActionPlanClient;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.runProjectAnalysis;
+
+@Ignore
+public class ActionPlanUiTest {
+
+  private static final String PROJECT_KEY = "sample";
+
+  @ClassRule
+  public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
+
+  @BeforeClass
+  public static void analyzeProject() {
+    orchestrator.resetData();
+
+    orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/actionPlan/one-issue-per-line-profile.xml"));
+    orchestrator.getServer().provisionProject("sample", "Sample");
+    orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-issue-per-line-profile");
+    runProjectAnalysis(orchestrator, "shared/xoo-sample");
+  }
+
+  protected static ActionPlanClient adminActionPlanClient() {
+    return orchestrator.getServer().adminWsClient().actionPlanClient();
+  }
+
+  @Before
+  public void resetData() {
+    // TODO should be done by a WS
+    orchestrator.getDatabase().truncate("action_plans");
+    assertThat(adminActionPlanClient().find(PROJECT_KEY)).isEmpty();
+  }
+
+  @Test
+  @Ignore("Must be refactored to use web services when applicable")
+  public void test_console() {
+    Selenese selenese = Selenese
+      .builder()
+      .setHtmlTestsInClasspath("action-plans-console",
+        "/actionPlan/ActionPlanUiTest/create_and_delete_action_plan.html",
+        "/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_date_in_past.html",
+        "/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_invalid_date.html",
+        "/actionPlan/ActionPlanUiTest/cannot_create_two_action_plans_with_same_name.html",
+        // SONAR-3200
+        "/actionPlan/ActionPlanUiTest/close_and_reopen_action_plan.html",
+        "/actionPlan/ActionPlanUiTest/edit_action_plan.html",
+        // SONAR-3198
+        "/actionPlan/ActionPlanUiTest/can_create_action_plan_with_date_today.html").build();
+    orchestrator.executeSelenese(selenese);
+  }
+
+}
diff --git a/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/can_create_action_plan_with_date_today.html b/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/can_create_action_plan_with_date_today.html
new file mode 100644 (file)
index 0000000..8aa6ca4
--- /dev/null
@@ -0,0 +1,89 @@
+<?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"/>
+    <title>can_create_action_plan_with_date_today</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">can_create_action_plan_with_date_today</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/action_plans/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>store</td>
+        <td>javascript{(new Date()).getFullYear()+'-'+((new Date()).getMonth()+1)+'-'+(new Date()).getDate()}</td>
+        <td>today</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=deadline</td>
+        <td>${today}</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*Sprint for 1.1*Edit*Close*Delete*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_date_in_past.html b/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_date_in_past.html
new file mode 100644 (file)
index 0000000..d4f749a
--- /dev/null
@@ -0,0 +1,84 @@
+<?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"/>
+    <title>cannot_create_action_plan_with_date_in_past</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">cannot_create_action_plan_with_date_in_past</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/action_plans/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=deadline</td>
+        <td>2000-12-31</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>css=.modal-error</td>
+        <td>*The dead-line can't be in the past*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_invalid_date.html b/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_action_plan_with_invalid_date.html
new file mode 100644 (file)
index 0000000..0d36d4f
--- /dev/null
@@ -0,0 +1,84 @@
+<?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"/>
+    <title>cannot_create_action_plan_with_invalid_date</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">cannot_create_action_plan_with_invalid_date</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/action_plans/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=deadline</td>
+        <td>31/12/2000</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>css=.modal-error</td>
+        <td>*date is not valid*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_two_action_plans_with_same_name.html b/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/cannot_create_two_action_plans_with_same_name.html
new file mode 100644 (file)
index 0000000..673504b
--- /dev/null
@@ -0,0 +1,144 @@
+<?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"/>
+    <title>cannot_create_two_action_plan_with_same_name</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">cannot_create_two_action_plan_with_same_name</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/action_plans/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*Sprint for 1.1*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>css=.modal-error</td>
+        <td>*An action plan with this name already exists in this project.*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>css=#create-action-plan-form .modal-foot .action</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>link=Delete</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>confirm-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>confirm-form</td>
+        <td>*Delete Action Plan*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>confirm-submit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>info</td>
+        <td>*Successfully deleted.*</td>
+    </tr>
+    <tr>
+        <td>assertNotText</td>
+        <td>action-plans</td>
+        <td>*Sprint for 1.1*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/close_and_reopen_action_plan.html b/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/close_and_reopen_action_plan.html
new file mode 100644 (file)
index 0000000..5d2917f
--- /dev/null
@@ -0,0 +1,134 @@
+<?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"/>
+    <title>close_and_reopen_action_plan</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">close_and_reopen_action_plan</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/action_plans/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*Sprint for 1.1*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=Close</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>store</td>
+        <td>javascript{(new Date()).getDate()+'*'+(new Date()).getFullYear()}</td>
+        <td>closureDay</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>content</td>
+        <td>*Action Plans*Closed Action Plans*Sprint for 1.1*${closureDay}*Reopen*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=Reopen</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>open-action-plans</td>
+        <td>*Sprint for 1.1*Close*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>link=Delete</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>confirm-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#confirm-form .modal-head</td>
+        <td>*Delete Action Plan*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>confirm-submit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>info</td>
+        <td>*Successfully deleted.*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>open-action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/create_and_delete_action_plan.html b/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/create_and_delete_action_plan.html
new file mode 100644 (file)
index 0000000..79e70d2
--- /dev/null
@@ -0,0 +1,119 @@
+<?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"/>
+    <title>create_and_delete_action_plan</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">create_and_delete_action_plan</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/action_plans/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=deadline</td>
+        <td>2100-12-31</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=description</td>
+        <td>Sprint in the far future</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>id=action-plans</td>
+        <td>*Sprint for 1.1*2100*No issues linked to this action plan yet.*Sprint in the far future*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>link=Delete</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>confirm-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#confirm-form .modal-head</td>
+        <td>*Delete Action Plan*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>confirm-submit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>info</td>
+        <td>*Successfully deleted.*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>open-action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/edit_action_plan.html b/it/it-tests/src/test/resources/actionPlan/ActionPlanUiTest/edit_action_plan.html
new file mode 100644 (file)
index 0000000..4caf225
--- /dev/null
@@ -0,0 +1,159 @@
+<?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"/>
+    <title>edit_action_plan</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">edit_action_plan</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/action_plans/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>create-link-action_plans</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>create-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#create-action-plan-form .modal-head</td>
+        <td>*Create Action Plan*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.1</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=deadline</td>
+        <td>2100-12-31</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=description</td>
+        <td>Sprint in the far future</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>link=Edit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>link=Edit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>edit-action-plan-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#edit-action-plan-form .modal-head</td>
+        <td>*Edit Action Plan: Sprint for 1.1*</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=name</td>
+        <td>Sprint for 1.2</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=deadline</td>
+        <td>2101-12-31</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=description</td>
+        <td>Sprint in the far future, very far</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>css=input[type=&quot;submit&quot;]</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>action-plans</td>
+        <td>*Sprint for 1.2*2101*No issues linked to this action plan yet.*Sprint in the far future, very far*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>link=Delete</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>confirm-form</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>css=#confirm-form .modal-head</td>
+        <td>*Delete Action Plan*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>confirm-submit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>info</td>
+        <td>*Successfully deleted.*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>open-action-plans</td>
+        <td>*No action plan*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/actionPlan/one-issue-per-line-profile.xml b/it/it-tests/src/test/resources/actionPlan/one-issue-per-line-profile.xml
new file mode 100644 (file)
index 0000000..28cebcc
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?><!-- Generated by Sonar -->
+<profile>
+  <name>one-issue-per-line-profile</name>
+  <language>xoo</language>
+  <rules>
+    <rule>
+      <repositoryKey>xoo</repositoryKey>
+      <key>OneIssuePerLine</key>
+      <priority>CRITICAL</priority>
+    </rule>
+  </rules>
+</profile>