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, fixed shog…
- Loading branch information
1 parent
3730e7a
commit caf91a6
Showing
24 changed files
with
438 additions
and
261 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
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.