From: Simon Brandhof Date: Fri, 16 Jun 2017 11:29:02 +0000 (+0200) Subject: Drop support of PhantomJS in integration tests X-Git-Tag: 6.5-M1~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cab4f87c88120c23c6173edbd5ddc6e18a862cfc;p=sonarqube.git Drop support of PhantomJS in integration tests --- diff --git a/.travis.yml b/.travis.yml index 35df96cfde4..960ab66f8d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,6 @@ cache: - server/sonar-web/node_modules - $HOME/jvm - $HOME/maven - - $HOME/phantomjs before_cache: # remove all the artifacts (JAR, ZIP) that are installed in local repo because of mvn deploy diff --git a/it/it-tests/src/test/java/it/lite/LiteTest.java b/it/it-tests/src/test/java/it/lite/LiteTest.java index 3a636529d6c..b888cf9e114 100644 --- a/it/it-tests/src/test/java/it/lite/LiteTest.java +++ b/it/it-tests/src/test/java/it/lite/LiteTest.java @@ -19,8 +19,6 @@ */ 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; @@ -33,13 +31,8 @@ import org.sonarqube.ws.client.component.TreeWsRequest; 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; @@ -106,20 +99,4 @@ public class LiteTest { 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"))); - } - } } diff --git a/it/it-tests/src/test/java/pageobjects/SelenideConfig.java b/it/it-tests/src/test/java/pageobjects/SelenideConfig.java index e69bfdc7739..e03561fc867 100644 --- a/it/it-tests/src/test/java/pageobjects/SelenideConfig.java +++ b/it/it-tests/src/test/java/pageobjects/SelenideConfig.java @@ -32,8 +32,7 @@ public class SelenideConfig { private enum Browser { firefox("(v46 and lower)"), marionette("(recent Firefox, require Geckodriver)"), - chrome("(require Chromedriver)"), - phantomjs("(headless)"); + chrome("(require Chromedriver)"); private final String label; diff --git a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/SelenideConfig.java b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/SelenideConfig.java index 9f30889effb..0e4c19e3f62 100644 --- a/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/SelenideConfig.java +++ b/tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/SelenideConfig.java @@ -29,7 +29,7 @@ import static java.util.Objects.requireNonNull; enum SelenideConfig { INSTANCE; - private static final Set SUPPORTED_BROWSERS = ImmutableSet.of("firefox", "phantomjs"); + private static final Set SUPPORTED_BROWSERS = ImmutableSet.of("firefox"); SelenideConfig() { Configuration.reportsFolder = "target/screenshots"; diff --git a/travis.sh b/travis.sh index b317f298813..0cc60cad32c 100755 --- a/travis.sh +++ b/travis.sh @@ -3,21 +3,6 @@ set -euo pipefail ./.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 @@ -181,8 +166,7 @@ BUILD) mvn install $MAVEN_ARGS -Dsource.skip=true fi - installPhantomJs - ./run-integration-tests.sh "Lite" "" -Dorchestrator.browser=phantomjs + ./run-integration-tests.sh "Lite" "" ;; WEB_TESTS)