aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-tests
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2015-09-02 14:43:28 +0200
committerDavid Gageot <david@gageot.net>2015-09-02 16:00:35 +0200
commitb7d62595b994ba1a78d41a3834418c53f81587ab (patch)
treebad0b8ccafbaab40229470735d5ddeb380735753 /it/it-tests
parent7bf080b812838d4c610ed367ffbfd0a82ec012ed (diff)
downloadsonarqube-b7d62595b994ba1a78d41a3834418c53f81587ab.tar.gz
sonarqube-b7d62595b994ba1a78d41a3834418c53f81587ab.zip
Better regexp support for Selenium its
Diffstat (limited to 'it/it-tests')
-rw-r--r--it/it-tests/src/test/java/administration/suite/ui/I18nTest.java4
-rw-r--r--it/it-tests/src/test/java/selenium/SeleneseTest.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/it/it-tests/src/test/java/administration/suite/ui/I18nTest.java b/it/it-tests/src/test/java/administration/suite/ui/I18nTest.java
index 14a9ec84f4d..13bd5808066 100644
--- a/it/it-tests/src/test/java/administration/suite/ui/I18nTest.java
+++ b/it/it-tests/src/test/java/administration/suite/ui/I18nTest.java
@@ -27,6 +27,7 @@ import com.sonar.orchestrator.selenium.Selenese;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
+import selenium.SeleneseTest;
import static util.ItUtils.projectDir;
@@ -53,8 +54,7 @@ public class I18nTest {
"/ui/i18n/french-pack.html",
"/ui/i18n/locale-with-france-country.html",
"/ui/i18n/locale-with-swiss-country.html").build();
- // Use the old runner because it fails with the new Selenium runner
- orchestrator.executeSelenese(selenese);
+ new SeleneseTest(selenese).runOn(orchestrator);
}
}
diff --git a/it/it-tests/src/test/java/selenium/SeleneseTest.java b/it/it-tests/src/test/java/selenium/SeleneseTest.java
index ecd716775fc..d45862843fc 100644
--- a/it/it-tests/src/test/java/selenium/SeleneseTest.java
+++ b/it/it-tests/src/test/java/selenium/SeleneseTest.java
@@ -270,7 +270,8 @@ public class SeleneseTest {
}
if (pattern.startsWith("regexp:")) {
- find(selector).should().match(Pattern.compile(pattern.substring(7)));
+ String expectedRegEx = pattern.replaceFirst("regexp:", ".*") + ".*";
+ find(selector).should().match(Pattern.compile(expectedRegEx, Pattern.DOTALL));
return;
}
@@ -287,7 +288,8 @@ public class SeleneseTest {
}
if (pattern.startsWith("regexp:")) {
- find(selector).should().not().match(Pattern.compile(pattern.substring(7)));
+ String expectedRegEx = pattern.replaceFirst("regexp:", ".*") + ".*";
+ find(selector).should().not().match(Pattern.compile(expectedRegEx, Pattern.DOTALL));
return;
}