aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-22 22:19:15 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-02-23 09:12:00 +0100
commitb94c3c5acca681d305e4a3cd93cdfafe4ad3cfeb (patch)
treec6aaf6ad27d92917d9478c074fbe702efba405a3
parent30aba95ec75c1a555177fafb41f2b4fa3540a22a (diff)
downloadsonarqube-5.5-M4.tar.gz
sonarqube-5.5-M4.zip
Improve reliability of Selenium tests5.5-M4
-rw-r--r--it/it-tests/src/test/java/it/analysis/IssueJsonReportTest.java3
-rw-r--r--it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java2
-rw-r--r--it/it-tests/src/test/java/util/selenium/LazyDomElement.java2
-rw-r--r--it/it-tests/src/test/java/util/selenium/SeleneseTest.java2
-rw-r--r--it/it-tests/src/test/resources/rule/ManualRulesTest/create_edit_delete_manual_rule.html4
5 files changed, 9 insertions, 4 deletions
diff --git a/it/it-tests/src/test/java/it/analysis/IssueJsonReportTest.java b/it/it-tests/src/test/java/it/analysis/IssueJsonReportTest.java
index f2c8a4a2cb2..1f3d6793b3a 100644
--- a/it/it-tests/src/test/java/it/analysis/IssueJsonReportTest.java
+++ b/it/it-tests/src/test/java/it/analysis/IssueJsonReportTest.java
@@ -280,6 +280,7 @@ public class IssueJsonReportTest {
assertThat(sanitize("5.0.0-5868-SNAPSHOT")).isEqualTo("<SONAR_VERSION>");
assertThat(sanitize("5.0-build1234")).isEqualTo("<SONAR_VERSION>");
assertThat(sanitize("5.0.1-build1234")).isEqualTo("<SONAR_VERSION>");
+ assertThat(sanitize("\"5.0.1-build1234\"")).isEqualTo("\"<SONAR_VERSION>\"");
}
@Test
@@ -290,7 +291,7 @@ public class IssueJsonReportTest {
private static String sanitize(String s) {
// sanitize sonarqube version: "5.4-SNAPSHOT" or "5.4-build1234"
s = s.replaceAll("\\d\\.\\d(.\\d)?(\\-.*)?\\-SNAPSHOT", "<SONAR_VERSION>");
- s = s.replaceAll("\\d\\.\\d(.\\d)?(\\-.*)?\\-build.*", "<SONAR_VERSION>");
+ s = s.replaceAll("\\d\\.\\d(.\\d)?(\\-.*)?\\-build(\\d)+", "<SONAR_VERSION>");
// sanitize issue uuid keys
s = s.replaceAll("\"[a-zA-Z_0-9\\-]{15,20}\"", "<ISSUE_KEY>");
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 77fe48f2942..f41537b95bb 100644
--- a/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java
+++ b/it/it-tests/src/test/java/it/issue/IssueNotificationsTest.java
@@ -199,7 +199,7 @@ public class IssueNotificationsTest extends AbstractIssueTest {
}
private static void waitUntilAllNotificationsAreDelivered() throws InterruptedException {
- Thread.sleep(5000);
+ Thread.sleep(10000);
}
}
diff --git a/it/it-tests/src/test/java/util/selenium/LazyDomElement.java b/it/it-tests/src/test/java/util/selenium/LazyDomElement.java
index 6f5eca2de14..29a9482f403 100644
--- a/it/it-tests/src/test/java/util/selenium/LazyDomElement.java
+++ b/it/it-tests/src/test/java/util/selenium/LazyDomElement.java
@@ -30,6 +30,7 @@ import javax.annotation.Nullable;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
class LazyDomElement {
@@ -115,6 +116,7 @@ class LazyDomElement {
execute("click", new Consumer<WebElement>() {
@Override
public void accept(WebElement element) {
+ new Actions(driver).moveToElement(element);
element.click();
}
});
diff --git a/it/it-tests/src/test/java/util/selenium/SeleneseTest.java b/it/it-tests/src/test/java/util/selenium/SeleneseTest.java
index a23cfb5828e..14b87375398 100644
--- a/it/it-tests/src/test/java/util/selenium/SeleneseTest.java
+++ b/it/it-tests/src/test/java/util/selenium/SeleneseTest.java
@@ -33,6 +33,7 @@ import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
import org.openqa.selenium.NotFoundException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.logging.LogEntries;
@@ -62,6 +63,7 @@ public class SeleneseTest {
this.driver = Browser.FIREFOX.getDriverForThread();
driver.manage().deleteAllCookies();
+ driver.manage().window().setSize(new Dimension(1280,1024));
for (File file : suite.getHtmlTests()) {
System.out.println();
diff --git a/it/it-tests/src/test/resources/rule/ManualRulesTest/create_edit_delete_manual_rule.html b/it/it-tests/src/test/resources/rule/ManualRulesTest/create_edit_delete_manual_rule.html
index 992ac0e5487..3ea73582b0b 100644
--- a/it/it-tests/src/test/resources/rule/ManualRulesTest/create_edit_delete_manual_rule.html
+++ b/it/it-tests/src/test/resources/rule/ManualRulesTest/create_edit_delete_manual_rule.html
@@ -34,7 +34,7 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
+ <td>waitForVisible</td>
<td>css=.js-create-manual-rule</td>
<td></td>
</tr>
@@ -74,7 +74,7 @@
<td></td>
</tr>
<tr>
- <td>assertText</td>
+ <td>waitForText</td>
<td>css=.coding-rule-details</td>
<td>glob:*New rule*This is a new rule*</td>
</tr>