From 8729403ee5cdbef4344c5ce084f284d692d3ece4 Mon Sep 17 00:00:00 2001 From: Chris Holt Date: Thu, 12 Nov 2015 21:49:15 -0600 Subject: [PATCH] New Firefox browser type for #223 --- src/canopy/canopy.fs | 3 ++- src/canopy/reporters.fs | 3 ++- src/canopy/types.fs | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/canopy/canopy.fs b/src/canopy/canopy.fs index 691179f1..4fb95902 100644 --- a/src/canopy/canopy.fs +++ b/src/canopy/canopy.fs @@ -678,8 +678,9 @@ let start b = | ChromeWithOptionsAndTimeSpan(options, timeSpan) -> new Chrome.ChromeDriver(chromeDir, options, timeSpan) :> IWebDriver | Firefox -> new FirefoxDriver() :> IWebDriver | FirefoxWithProfile profile -> new FirefoxDriver(profile) :> IWebDriver - | FirefoxWithPath path -> new FirefoxDriver(Firefox.FirefoxBinary(path), Firefox.FirefoxProfile()) :> IWebDriver + | FirefoxWithPath path -> new FirefoxDriver(new Firefox.FirefoxBinary(path), Firefox.FirefoxProfile()) :> IWebDriver | FirefoxWithUserAgent userAgent -> firefoxWithUserAgent userAgent + | FirefoxWithPathAndTimeSpan(path, timespan) -> new FirefoxDriver(new Firefox.FirefoxBinary(path), Firefox.FirefoxProfile(), timespan) :> IWebDriver | Safari ->new Safari.SafariDriver() :> IWebDriver | PhantomJS -> autoPinBrowserRightOnLaunch <- false diff --git a/src/canopy/reporters.fs b/src/canopy/reporters.fs index e59892d3..47034737 100644 --- a/src/canopy/reporters.fs +++ b/src/canopy/reporters.fs @@ -195,9 +195,10 @@ type LiveHtmlReporter(browser : BrowserStartMode, driverPath : string) = | ChromeWithOptionsAndTimeSpan(options, timeSpan) -> new OpenQA.Selenium.Chrome.ChromeDriver(driverPath, options, timeSpan) :> IWebDriver | Firefox -> new OpenQA.Selenium.Firefox.FirefoxDriver() :> IWebDriver | FirefoxWithProfile profile -> new OpenQA.Selenium.Firefox.FirefoxDriver(profile) :> IWebDriver - | FirefoxWithPath path -> new OpenQA.Selenium.Firefox.FirefoxDriver(Firefox.FirefoxBinary(path), Firefox.FirefoxProfile()) :> IWebDriver + | FirefoxWithPath path -> new OpenQA.Selenium.Firefox.FirefoxDriver(new Firefox.FirefoxBinary(path), Firefox.FirefoxProfile()) :> IWebDriver | ChromeWithUserAgent userAgent -> raise(System.Exception("Sorry ChromeWithUserAgent can't be used for LiveHtmlReporter")) | FirefoxWithUserAgent userAgent -> raise(System.Exception("Sorry FirefoxWithUserAgent can't be used for LiveHtmlReporter")) + | FirefoxWithPathAndTimeSpan(path, timespan) -> new OpenQA.Selenium.Firefox.FirefoxDriver(new Firefox.FirefoxBinary(path), Firefox.FirefoxProfile(), timespan) :> IWebDriver | Safari -> new OpenQA.Selenium.Safari.SafariDriver() :> IWebDriver | PhantomJS | PhantomJSProxyNone -> raise(System.Exception("Sorry PhantomJS can't be used for LiveHtmlReporter")) | Remote(_,_) -> raise(System.Exception("Sorry Remote can't be used for LiveHtmlReporter")) diff --git a/src/canopy/types.fs b/src/canopy/types.fs index cfed1f7c..18d52f22 100644 --- a/src/canopy/types.fs +++ b/src/canopy/types.fs @@ -39,6 +39,7 @@ type BrowserStartMode = | FirefoxWithProfile of Firefox.FirefoxProfile | FirefoxWithPath of string | FirefoxWithUserAgent of string + | FirefoxWithPathAndTimeSpan of string * TimeSpan | IE | IEWithOptions of IE.InternetExplorerOptions | IEWithOptionsAndTimeSpan of IE.InternetExplorerOptions * TimeSpan