*/
package it.lite;
-import com.codeborne.selenide.CollectionCondition;
-import com.codeborne.selenide.Condition;
import com.sonar.orchestrator.Orchestrator;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.sonarqube.ws.client.issue.SearchWsRequest;
import org.sonarqube.ws.client.measure.ComponentTreeWsRequest;
import org.sonarqube.ws.client.measure.ComponentWsRequest;
-import pageobjects.Navigation;
-import pageobjects.RuleItem;
-import pageobjects.RulesPage;
import util.ItUtils;
-import static com.codeborne.selenide.Condition.hasText;
-import static com.codeborne.selenide.Condition.or;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
assertThat(c.getMeasuresList()).extracting(m -> m.getMetric()).containsOnly("lines", "ncloc");
});
}
-
- @Test
- public void open_page_rules() {
- RulesPage rulesPage = Navigation.get(ORCHESTRATOR)
- .openHomepage()
- .clickOnRules();
-
- // wait for rules to be displayed
- rulesPage.getRules().shouldHave(CollectionCondition.sizeGreaterThan(0));
-
- assertThat(rulesPage.getTotal()).isGreaterThan(0);
- for (RuleItem ruleItem : rulesPage.getRulesAsItems()) {
- ruleItem.getTitle().should(Condition.visible);
- ruleItem.getMetadata().should(or("have type", hasText("Bug"), hasText("Code Smell"), hasText("Vulnerability")));
- }
- }
}
private enum Browser {
firefox("(v46 and lower)"),
marionette("(recent Firefox, require Geckodriver)"),
- chrome("(require Chromedriver)"),
- phantomjs("(headless)");
+ chrome("(require Chromedriver)");
private final String label;
./.travis/setup_ramdisk.sh
-function installPhantomJs {
- echo "Setup PhantomJS 2.1"
- mkdir -p ~/phantomjs
- pushd ~/phantomjs > /dev/null
- if [ ! -d "phantomjs-2.1.1-linux-x86_64" ]; then
- echo "Download PhantomJS"
- wget https://repox.sonarsource.com/public-3rd-parties/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O phantomjs-2.1.1-linux-x86_64.tar.bz2
- tar -xf phantomjs-2.1.1-linux-x86_64.tar.bz2
- rm phantomjs-2.1.1-linux-x86_64.tar.bz2
- fi
- popd > /dev/null
- export PHANTOMJS_HOME=~/phantomjs/phantomjs-2.1.1-linux-x86_64
- export PATH=$PHANTOMJS_HOME/bin:$PATH
-}
-
#
# A (too) old version of JDK8 is installed by default on Travis.
# This method is preferred over Travis apt oracle-java8-installer because
mvn install $MAVEN_ARGS -Dsource.skip=true
fi
- installPhantomJs
- ./run-integration-tests.sh "Lite" "" -Dorchestrator.browser=phantomjs
+ ./run-integration-tests.sh "Lite" ""
;;
WEB_TESTS)