Skip to content

Commit

Permalink
[misc] Use headless Chrome and Chrome Driver to run the Jasmine tests…
Browse files Browse the repository at this point in the history
… instead of PhantomJS in order to:

* ensure that the test behavior is as close as possible to the run-time behavior as experienced by the user
* be able to use all the JavaScript APIs available in supported browsers (PhantomJS is dead and it doesn't have all the APIs)
  • Loading branch information
mflorea committed Sep 9, 2020
1 parent b87da6d commit 7411b4b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
29 changes: 24 additions & 5 deletions plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,33 @@
<options>camelcase,maxparams:5,maxdepth:3,maxstatements:20,maxcomplexity:10,maxlen:120</options>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<!-- Force a slightly older version of the Chrome Driver in case we don't have the latest Chrome
installed locally. -->
<name>wdm.chromeDriverVersion</name>
<value>85.0.4183.87</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<!-- We want a more recent version of Jasmine and we want to use the PhantomJS driver-->
<version>2.2</version>
<!-- We want a more recent version of Jasmine because we want to use the (headless) Chrome driver. -->
<version>3.0-alpha-01</version>
<executions>
<execution>
<goals>
Expand All @@ -124,9 +146,6 @@
</execution>
</executions>
<configuration>
<phantomjs>
<version>2.1.1</version>
</phantomjs>
<specRunnerTemplate>REQUIRE_JS</specRunnerTemplate>
<!-- jasmine-require-config.txt is filtered so we load it from the test output directory. -->
<customRunnerConfiguration>
Expand Down
2 changes: 1 addition & 1 deletion plugins/src/test/javascript/xwiki-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(['jquery', 'textSelection'], function($, textSelectionAPI) {

assertSelection('abc [[ab|c>>x|yz]] xyz', 'abc <a href="#xyz">ab|c|</a> xyz', 'abc [[ab|c|>>xyz]] xyz');

assertSelection('abc [|[abc>>xyz]|] xyz', 'abc <a href="#xyz">|abc|</a> xyz', 'abc |[[abc|>>xyz]] xyz');
assertSelection('abc [|[abc>>xyz]|] xyz', 'abc |<a href="#xyz">abc|</a> xyz', 'abc |[[abc|>>xyz]] xyz');

assertSelection('{{abc/}} **a|bc**', 'xyz <b>a|bc</b>');

Expand Down

0 comments on commit 7411b4b

Please sign in to comment.