@@ -24,27 +24,29 @@ import org.openqa.selenium.htmlunit.HtmlUnitDriver
24
24
import org .openqa .selenium .edge .EdgeDriver
25
25
import org .openqa .selenium .By
26
26
import org .openqa .selenium .WebElement
27
- import java .util .concurrent .TimeUnit
28
27
28
+ import java .util .concurrent .TimeUnit
29
29
import scala .collection .JavaConverters ._
30
30
import org .openqa .selenium .Cookie
31
- import java .util .Date
32
31
32
+ import java .util .Date
33
33
import org .scalatest .time .Span
34
34
import org .openqa .selenium .TakesScreenshot
35
35
import org .openqa .selenium .OutputType
36
+
36
37
import java .io .File
37
38
import java .io .FileOutputStream
38
39
import java .io .FileInputStream
39
-
40
40
import org .openqa .selenium .Alert
41
41
import org .openqa .selenium .support .ui .Select
42
42
import org .scalatest .exceptions .TestFailedException
43
43
import org .scalatest .exceptions .StackDepthException
44
44
import org .openqa .selenium .JavascriptExecutor
45
45
import org .scalactic .source
46
46
import org .openqa .selenium .firefox .FirefoxOptions
47
+
47
48
import java .io .Closeable
49
+ import java .time .Duration
48
50
49
51
/**
50
52
* Trait that provides a domain specific language (DSL) for writing browser-based tests using <a href="http://seleniumhq.org">Selenium</a>.
@@ -4015,7 +4017,7 @@ trait WebBrowser {
4015
4017
* @param driver the <code>WebDriver</code> on which to set the implicit wait
4016
4018
*/
4017
4019
def implicitlyWait (timeout : Span )(implicit driver : WebDriver ): Unit = {
4018
- driver.manage.timeouts.implicitlyWait(timeout.totalNanos, TimeUnit . NANOSECONDS )
4020
+ driver.manage.timeouts.implicitlyWait(Duration .ofNanos( timeout.totalNanos) )
4019
4021
}
4020
4022
4021
4023
/**
@@ -4599,7 +4601,7 @@ trait WebBrowser {
4599
4601
* @param timeout the amount of time to wait for an asynchronous script to finish execution before throwing exception
4600
4602
*/
4601
4603
def setScriptTimeout (timeout : Span )(implicit driver : WebDriver ): Unit = {
4602
- driver.manage().timeouts().setScriptTimeout( timeout.totalNanos, TimeUnit . NANOSECONDS );
4604
+ driver.manage().timeouts().scriptTimeout( Duration .ofNanos( timeout.totalNanos) );
4603
4605
}
4604
4606
4605
4607
// Clears the text field or area, then presses the passed keys
@@ -4860,7 +4862,7 @@ object InternetExplorer extends InternetExplorer
4860
4862
*/
4861
4863
trait Edge extends WebBrowser with Driver with ScreenshotCapturer {
4862
4864
/**
4863
- * <code>WebBrowser</code> subtrait that defines an implicit <code>WebDriver</code> for Safari (an <code>org.openqa.selenium.safari.SafariDriver </code>).
4865
+ * <code>WebBrowser</code> subtrait that defines an implicit <code>WebDriver</code> for Microsoft Edge (an <code>org.openqa.selenium.edge.EdgeDriver </code>).
4864
4866
*/
4865
4867
implicit val webDriver = new EdgeDriver ()
4866
4868
0 commit comments