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 19:29:12 +0200
commitc832373a72d09eaada8093774ebdfd71586137dd (patch)
treea4a5738a6a6adbba99b6af121c40e32d40fcfe61 /it/it-tests
parentc392aadff1f0822d502e6f99b480a902c5d3e082 (diff)
downloadsonarqube-c832373a72d09eaada8093774ebdfd71586137dd.tar.gz
sonarqube-c832373a72d09eaada8093774ebdfd71586137dd.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 6db97d04de3..39e36a4c767 100644
--- a/it/it-tests/src/test/java/selenium/SeleneseTest.java
+++ b/it/it-tests/src/test/java/selenium/SeleneseTest.java
@@ -291,7 +291,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;
}
@@ -308,7 +309,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;
}