forked from shogowada/scalajs-reactjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added cross-compilation for scala 2.13.x and scala-js 1.x (#1)
- Loading branch information
1 parent
3730e7a
commit d27ee2a
Showing
24 changed files
with
441 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
language: scala | ||
sudo: required | ||
jdk: | ||
- oraclejdk8 | ||
dist: trusty | ||
|
||
language: scala | ||
|
||
scala: | ||
- 2.12.2 | ||
|
||
jdk: | ||
- oraclejdk8 | ||
|
||
# - 2.13.1 #TODO | ||
env: | ||
- SCALAJS_VERSION=0.6.31 | ||
# - SCALAJS_VERSION=1.1.0 #TODO | ||
addons: | ||
chrome: stable | ||
apt: | ||
sources: | ||
- google-chrome | ||
packages: | ||
- google-chrome-stable | ||
|
||
- chromium-chromedriver | ||
before_script: | ||
- wget -N http://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip | ||
- unzip chromedriver_linux64.zip | ||
- sudo apt-get install libnss3 | ||
- sudo apt-get --only-upgrade install google-chrome-stable | ||
- sudo cp chromedriver /usr/local/bin/. | ||
- sudo chmod +x /usr/local/bin/chromedriver | ||
- sudo ln --symbolic /usr/lib/chromium-browser/chromedriver "/usr/local/bin/chromedriver" | ||
- "export DISPLAY=:99" | ||
- "sh -e /etc/init.d/xvfb start" | ||
- sleep 3 # give xvfb some time to start | ||
- ". $HOME/.nvm/nvm.sh" | ||
- "nvm install node" | ||
- "nvm use node" | ||
|
||
script: | ||
- sbt ++$TRAVIS_SCALA_VERSION fastOptJS::webpack | ||
- sbt ++$TRAVIS_SCALA_VERSION it:test | ||
- sbt ++$TRAVIS_SCALA_VERSION fastOptJS::webpack it:test | ||
cache: | ||
directories: | ||
- "$HOME/.ivy2/cache" | ||
- "$HOME/.sbt" | ||
before_cache: | ||
# Cleanup the cached directories to avoid unnecessary cache updates | ||
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete | ||
- find $HOME/.sbt -name "*.lock" -print -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 20 additions & 10 deletions
30
example/test/src/it/scala/io/github/shogowada/scalajs/reactjs/example/BaseTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
package io.github.shogowada.scalajs.reactjs.example | ||
|
||
import org.openqa.selenium.UnexpectedAlertBehaviour | ||
import org.openqa.selenium.chrome.ChromeDriver | ||
import org.openqa.selenium.chrome.{ChromeDriver, ChromeOptions} | ||
import org.openqa.selenium.remote.{CapabilityType, DesiredCapabilities} | ||
import org.openqa.selenium.{UnexpectedAlertBehaviour, WebDriver} | ||
import org.scalatest.concurrent.Eventually | ||
import org.scalatest.selenium.{Driver, WebBrowser} | ||
import org.scalatest.{Matchers, path} | ||
import org.scalatest.freespec.AnyFreeSpec | ||
import org.scalatest.matchers.should | ||
import org.scalatest.time.{Millis, Seconds, Span} | ||
import org.scalatestplus.selenium._ | ||
|
||
object BaseTest { | ||
val webDriver = { | ||
|
||
private lazy val webDriver: WebDriver = { | ||
val capabilities = new DesiredCapabilities() | ||
capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE) | ||
new ChromeDriver(capabilities) | ||
new ChromeDriver(new ChromeOptions().merge(capabilities)) | ||
} | ||
|
||
Runtime.getRuntime.addShutdownHook(new Thread(() => webDriver.quit())) | ||
} | ||
|
||
trait BaseTest extends path.FreeSpec | ||
with WebBrowser with Driver | ||
with Matchers | ||
trait BaseTest extends AnyFreeSpec | ||
with WebBrowser | ||
with Driver | ||
with should.Matchers | ||
with Eventually { | ||
override implicit val webDriver = BaseTest.webDriver | ||
|
||
override implicit val patienceConfig: PatienceConfig = PatienceConfig( | ||
timeout = scaled(Span(1, Seconds)), | ||
interval = scaled(Span(50, Millis)) | ||
) | ||
|
||
implicit val webDriver: WebDriver = BaseTest.webDriver | ||
} |
Oops, something went wrong.