Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ If ScalaTest has saved you time, helped you ship better software, or become a ke

**Usage**

To use it for ScalaTest 3.2.19 and Selenium 4.21.x:
To use it for ScalaTest 3.3.0-RC1 and Selenium 4.35.x:

SBT:

```
libraryDependencies += "org.scalatestplus" %% "selenium-4-21" % "3.2.19.0" % "test"
libraryDependencies += "org.scalatestplus" %% "selenium-4-35" % "3.3.0.0-RC1" % "test"
```

Maven:

```
<dependency>
<groupId>org.scalatestplus</groupId>
<artifactId>selenium-4-21_3</artifactId>
<version>3.2.19.0</version>
<artifactId>selenium-4-35_3</artifactId>
<version>3.3.0.0-RC1</version>
<scope>test</scope>
</dependency>
```
Expand All @@ -39,4 +39,5 @@ Please use the following commands to publish to Sonatype:

```
$ sbt +publishSigned
$ sbt sonaUpload
```
21 changes: 9 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import java.io.PrintWriter
import scala.io.Source

name := "selenium-4.21"
name := "selenium-4.35"

organization := "org.scalatestplus"

version := "3.2.19.0"
version := "3.3.0.0-RC1"

homepage := Some(url("https://github.com/scalatest/scalatestplus-selenium"))

Expand All @@ -26,17 +26,17 @@ developers := List(
)
)

scalaVersion := "2.13.13"
scalaVersion := "2.13.16"

crossScalaVersions := List("2.11.12", "2.12.19", "2.13.13", "3.3.3")
crossScalaVersions := List("2.11.12", "2.12.20", scalaVersion.value, "3.3.6")

libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest-core" % "3.2.19",
"org.seleniumhq.selenium" % "selenium-java" % "4.21.0",
"org.scalatest" %% "scalatest-core" % "3.3.0-RC1",
"org.seleniumhq.selenium" % "selenium-java" % "4.35.0",
"org.seleniumhq.selenium" % "htmlunit-driver" % "4.13.0",
"org.eclipse.jetty" % "jetty-webapp" % "9.4.48.v20220622" % Test,
"org.scalatest" %% "scalatest-funspec" % "3.2.19" % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % "3.2.19" % Test
"org.scalatest" %% "scalatest-funspec" % "3.3.0-RC1" % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % "3.3.0-RC1" % Test
)

import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}
Expand Down Expand Up @@ -83,10 +83,7 @@ OsgiKeys.additionalHeaders:= Map(
"Bundle-Vendor" -> "Artima, Inc."
)

publishTo := {
val nexus = "https://oss.sonatype.org/"
Some("publish-releases" at nexus + "service/local/staging/deploy/maven2")
}
publishTo := localStaging.value

publishMavenStyle := true

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.8
sbt.version=1.11.4
14 changes: 8 additions & 6 deletions src/main/scala-2/org/scalatestplus/selenium/WebBrowser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,29 @@ import org.openqa.selenium.htmlunit.HtmlUnitDriver
import org.openqa.selenium.edge.EdgeDriver
import org.openqa.selenium.By
import org.openqa.selenium.WebElement
import java.util.concurrent.TimeUnit

import java.util.concurrent.TimeUnit
import scala.collection.JavaConverters._
import org.openqa.selenium.Cookie
import java.util.Date

import java.util.Date
import org.scalatest.time.Span
import org.openqa.selenium.TakesScreenshot
import org.openqa.selenium.OutputType

import java.io.File
import java.io.FileOutputStream
import java.io.FileInputStream

import org.openqa.selenium.Alert
import org.openqa.selenium.support.ui.Select
import org.scalatest.exceptions.TestFailedException
import org.scalatest.exceptions.StackDepthException
import org.openqa.selenium.JavascriptExecutor
import org.scalactic.source
import org.openqa.selenium.firefox.FirefoxOptions

import java.io.Closeable
import java.time.Duration

/**
* Trait that provides a domain specific language (DSL) for writing browser-based tests using <a href="http://seleniumhq.org">Selenium</a>.
Expand Down Expand Up @@ -4015,7 +4017,7 @@ trait WebBrowser {
* @param driver the <code>WebDriver</code> on which to set the implicit wait
*/
def implicitlyWait(timeout: Span)(implicit driver: WebDriver): Unit = {
driver.manage.timeouts.implicitlyWait(timeout.totalNanos, TimeUnit.NANOSECONDS)
driver.manage.timeouts.implicitlyWait(Duration.ofNanos(timeout.totalNanos))
}

/**
Expand Down Expand Up @@ -4599,7 +4601,7 @@ trait WebBrowser {
* @param timeout the amount of time to wait for an asynchronous script to finish execution before throwing exception
*/
def setScriptTimeout(timeout: Span)(implicit driver: WebDriver): Unit = {
driver.manage().timeouts().setScriptTimeout(timeout.totalNanos, TimeUnit.NANOSECONDS);
driver.manage().timeouts().scriptTimeout(Duration.ofNanos(timeout.totalNanos));
}

// Clears the text field or area, then presses the passed keys
Expand Down Expand Up @@ -4860,7 +4862,7 @@ object InternetExplorer extends InternetExplorer
*/
trait Edge extends WebBrowser with Driver with ScreenshotCapturer {
/**
* <code>WebBrowser</code> subtrait that defines an implicit <code>WebDriver</code> for Safari (an <code>org.openqa.selenium.safari.SafariDriver</code>).
* <code>WebBrowser</code> subtrait that defines an implicit <code>WebDriver</code> for Microsoft Edge (an <code>org.openqa.selenium.edge.EdgeDriver</code>).
*/
implicit val webDriver = new EdgeDriver()

Expand Down
Loading