diff options
author | Jenkins CI <ci@sonarsource.com> | 2016-05-25 14:45:59 +0200 |
---|---|---|
committer | Jenkins CI <ci@sonarsource.com> | 2016-05-25 14:45:59 +0200 |
commit | dbe178b8eab557a42451dfe5b37a61223c5c1047 (patch) | |
tree | 8adf74d68210dcbe4999c26fcfcae6e487a3de87 /it | |
parent | 82d87617e686f8f99abe2323f98214aa2d8f4182 (diff) | |
parent | 808926010755eb05a3422ca4843ab31b055ab3b9 (diff) | |
download | sonarqube-dbe178b8eab557a42451dfe5b37a61223c5c1047.tar.gz sonarqube-dbe178b8eab557a42451dfe5b37a61223c5c1047.zip |
Automatic merge from branch-5.6
* origin/branch-5.6:
Remove a Selenium test because of FP
fix TechnicalDebtWidgetTest by using dynamic date
Try to improve IT checks
Diffstat (limited to 'it')
5 files changed, 25 insertions, 77 deletions
diff --git a/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java b/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java index a5796f91824..dcf73a48154 100644 --- a/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java +++ b/it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java @@ -189,7 +189,6 @@ public class ProjectAdministrationTest { Selenese selenese = Selenese.builder() .setHtmlTestsInClasspath("project-bulk-update-keys", "/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html", - "/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-input.html", "/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html", "/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-success.html" ).build(); diff --git a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java index 989545d9ec9..7350325bff8 100644 --- a/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java +++ b/it/it-tests/src/test/java/it/qualityModel/TechnicalDebtWidgetTest.java @@ -24,6 +24,7 @@ import com.sonar.orchestrator.build.SonarRunner; import com.sonar.orchestrator.locator.FileLocation; import com.sonar.orchestrator.selenium.Selenese; import it.Category2Suite; +import org.apache.commons.lang.time.DateUtils; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; @@ -31,6 +32,9 @@ import org.junit.experimental.categories.Category; import util.QaOnly; import util.selenium.SeleneseTest; +import java.text.SimpleDateFormat; +import java.util.Date; + import static util.ItUtils.projectDir; @Category(QaOnly.class) @@ -55,8 +59,8 @@ public class TechnicalDebtWidgetTest { // need to execute the build twice in order to have history widgets // we made some exclusions to have variations in diff mode - scanProject("2011-06-01", "**/a2/**"); - scanProject("2012-02-01", ""); + scanProject(getPastDate(20), "**/a2/**"); + scanProject(getPastDate(10), ""); } private static void scanProject(String date, String excludes) { @@ -93,4 +97,8 @@ public class TechnicalDebtWidgetTest { ).build()).runOn(orchestrator); } + private static String getPastDate(int nbPastDays){ + return new SimpleDateFormat("yyyy-MM-dd").format(DateUtils.addDays(new Date(), nbPastDays * -1)); + } + } diff --git a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html b/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html index d6c7ebb9662..3a80a92df24 100644 --- a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html +++ b/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html @@ -65,12 +65,17 @@ </tr> <tr> <td>waitForText</td> - <td>content</td> - <td>*Bulk update can not be performed*The replacement of "com.sonarsource.it.samples:multi-modules-sample:module_a" by "com.sonarsource.it.samples:multi-modules-sample:module_b" is impossible as it would result in duplicate keys (in red below):*</td> + <td>css=#content h1</td> + <td>*Bulk update can not be performed*</td> </tr> <tr> - <td>waitForText</td> - <td>content</td> + <td>assertText</td> + <td>css=#content p</td> + <td>*The replacement of "com.sonarsource.it.samples:multi-modules-sample:module_a" by "com.sonarsource.it.samples:multi-modules-sample:module_b" is impossible as it would result in duplicate keys (in red below):*</td> +</tr> +<tr> + <td>assertText</td> + <td>css=#content .data</td> <td>*Duplicate key*</td> </tr> <tr> diff --git a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-input.html b/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-input.html deleted file mode 100644 index aec21d4e29d..00000000000 --- a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-input.html +++ /dev/null @@ -1,69 +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"/> - <title>bulk-update-impossible-because-no-input</title> -</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/login</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>/dashboard/index/com.sonarsource.it.samples:multi-modules-sample</td> - <td></td> - </tr> - <tr> - <td>click</td> - <td>css=#context-navigation .navbar-admin-link</td> - <td></td> - </tr> - <tr> - <td>waitForElementPresent</td> - <td>link=Update Key</td> - <td></td> - </tr> - <tr> - <td>clickAndWait</td> - <td>link=Update Key</td> - <td></td> - </tr> - <tr> - <td>clickAndWait</td> - <td>id=bulk_update_button</td> - <td></td> - </tr> - <tr> - <td>waitForText</td> - <td>content</td> - <td>*The two fields can not be blank for the bulk update.*</td> - </tr> - </tbody> -</table> -</body> -</html> diff --git a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html b/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html index b5575100d6b..2e667543a15 100644 --- a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html +++ b/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html @@ -70,7 +70,12 @@ </tr> <tr> <td>waitForText</td> - <td>content</td> + <td>css=#content h1</td> + <td>*Bulk update can not be performed*</td> + </tr> + <tr> + <td>assertText</td> + <td>css=#content</td> <td>*Bulk update can not be performed*No key contains the string to replace ("foo").*</td> </tr> <tr> |