Skip to content

Commit 876eee5

Browse files
committed
Added Edge driver to WebBrowser.scala.
1 parent 81d9f89 commit 876eee5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/main/scala/org/scalatestplus/selenium/WebBrowser.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import org.openqa.selenium.safari.SafariDriver
2121
import org.openqa.selenium.chrome.ChromeDriver
2222
import org.openqa.selenium.ie.InternetExplorerDriver
2323
import org.openqa.selenium.htmlunit.HtmlUnitDriver
24+
import org.openqa.selenium.edge.EdgeDriver
2425
import org.openqa.selenium.By
2526
import org.openqa.selenium.WebElement
2627
import java.util.concurrent.TimeUnit
@@ -4758,6 +4759,23 @@ trait InternetExplorer extends WebBrowser with Driver with ScreenshotCapturer {
47584759
*/
47594760
object InternetExplorer extends InternetExplorer
47604761

4762+
/**
4763+
* <code>WebBrowser</code> subtrait that defines an implicit <code>WebDriver</code> for Microsoft Edge (an <code>org.openqa.selenium.edge.EdgeDriver</code>).
4764+
*/
4765+
trait Edge extends WebBrowser with Driver with ScreenshotCapturer {
4766+
/**
4767+
* <code>WebBrowser</code> subtrait that defines an implicit <code>WebDriver</code> for Safari (an <code>org.openqa.selenium.safari.SafariDriver</code>).
4768+
*/
4769+
implicit val webDriver = new EdgeDriver()
4770+
4771+
/**
4772+
* Captures a screenshot and saves it as a file in the specified directory.
4773+
*/
4774+
def captureScreenshot(directory: String): Unit = {
4775+
capture toDir directory
4776+
}
4777+
}
4778+
47614779
/*
47624780
* <p>
47634781
* If you mix in <a href="../ScreenshotOnFailure.html"><code>ScreenshotOnFailure</code></a>, ScalaTest will capture a screenshot and store it to either the system temp directory

0 commit comments

Comments
 (0)