mirror of
https://github.com/SonarSource/sonarqube.git
synced 2024-08-08 03:05:57 +02:00
Better regexp support for Selenium its
This commit is contained in:
parent
bdf5c4dfcc
commit
aa224322a2
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user