]> source.dussan.org Git - sonarqube.git/commitdiff
Drop support of PhantomJS in integration tests
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 16 Jun 2017 11:29:02 +0000 (13:29 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Sat, 17 Jun 2017 15:28:21 +0000 (17:28 +0200)
.travis.yml
it/it-tests/src/test/java/it/lite/LiteTest.java
it/it-tests/src/test/java/pageobjects/SelenideConfig.java
tests/upgrade/src/test/java/org/sonarsource/sonarqube/upgrade/SelenideConfig.java
travis.sh

index 35df96cfde4b98e1e1dfd3ae53dcb1a51d57eb43..960ab66f8d77f908a69c59b5a0228455ba51d152 100644 (file)
@@ -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
index 3a636529d6cd95555a5bb1366c051b3587b08fe3..b888cf9e11464304812c2d34d545111b34b80c3f 100644 (file)
@@ -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")));
-    }
-  }
 }
index e69bfdc773911a7708f3843cf08235d38c09dc46..e03561fc8679a8bdb88dfa5ab6b68c0f983cd94b 100644 (file)
@@ -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;
 
index 9f30889effbe353f443dd3fd303fe78ebe681332..0e4c19e3f624224641f881d47380e2020b2266f6 100644 (file)
@@ -29,7 +29,7 @@ import static java.util.Objects.requireNonNull;
 enum SelenideConfig {
   INSTANCE;
 
-  private static final Set<String> SUPPORTED_BROWSERS = ImmutableSet.of("firefox", "phantomjs");
+  private static final Set<String> SUPPORTED_BROWSERS = ImmutableSet.of("firefox");
 
   SelenideConfig() {
     Configuration.reportsFolder = "target/screenshots";
index b317f298813f176c79290145cd4613156dfb1488..0cc60cad32cb06f40958ebc131de872f38495709 100755 (executable)
--- 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)