diff --git a/basictests/Program.fs b/basictests/Program.fs index 8f2aa10e..e79f25a0 100644 --- a/basictests/Program.fs +++ b/basictests/Program.fs @@ -6,7 +6,7 @@ open runner open configuration open reporters -start firefox +start chrome let mainBrowser = browser elementTimeout <- 3.0 compareTimeout <- 3.0 @@ -281,39 +281,6 @@ before (fun _ -> Console.WriteLine "only before set now") url testpage "#firstName" == "John1") -context "alert tests" -before (fun _ -> !^ "http://lefthandedgoat.github.io/canopy/testpages/alert") - -"alert box should have 'Alert Test'" &&& (fun _ -> - click "#alert_test" - alert() == "Alert Test" - acceptAlert()) - -"alert box should have 'Alert Test'" &&& (fun _ -> - click "#alert_test" - alert() == "Alert Test" - dismissAlert()) - -"alert box should fail correctly when expecting wrong message" &&& (fun _ -> - failsWith "equality check failed. expected: Not the message, got: Alert Test" - click "#alert_test" - alert() == "Not the message") - -"confirmation box should have 'Confirmation Test'" &&& (fun _ -> - click "#confirmation_test" - alert() == "Confirmation Test" - acceptAlert()) - -"confirmation box should have 'Confirmation Test'" &&& (fun _ -> - click "#confirmation_test" - alert() == "Confirmation Test" - dismissAlert()) - -"confirmation box should fail correctly when expecting wrong message" &&& (fun _ -> - failsWith "equality check failed. expected: Not the message, got: Confirmation Test" - click "#confirmation_test" - alert() == "Not the message") - context "other tests" "define a custom wait for using any function that takes in unit and returns bool" &&& (fun _ -> @@ -406,6 +373,41 @@ context "dragging" click "#task_editor_buttons .save_button" ".handle" --> ".inprogress") +if not (browser :? OpenQA.Selenium.PhantomJS.PhantomJSDriver) then + context "alert tests" + + before (fun _ -> !^ "http://lefthandedgoat.github.io/canopy/testpages/alert") + + "alert box should have 'Alert Test'" &&& (fun _ -> + click "#alert_test" + alert() == "Alert Test" + acceptAlert()) + + "alert box should have 'Alert Test'" &&& (fun _ -> + click "#alert_test" + alert() == "Alert Test" + dismissAlert()) + + "alert box should fail correctly when expecting wrong message" &&& (fun _ -> + failsWith "equality check failed. expected: Not the message, got: Alert Test" + click "#alert_test" + alert() == "Not the message") + + "confirmation box should have 'Confirmation Test'" &&& (fun _ -> + click "#confirmation_test" + alert() == "Confirmation Test" + acceptAlert()) + + "confirmation box should have 'Confirmation Test'" &&& (fun _ -> + click "#confirmation_test" + alert() == "Confirmation Test" + dismissAlert()) + + "confirmation box should fail correctly when expecting wrong message" &&& (fun _ -> + failsWith "equality check failed. expected: Not the message, got: Confirmation Test" + click "#confirmation_test" + alert() == "Not the message") + context "tiling windows" "start multiple browsers and tile them" &&& (fun _ -> start chrome diff --git a/canopy/canopy.fs b/canopy/canopy.fs index 7a8cbb23..83354b0d 100644 --- a/canopy/canopy.fs +++ b/canopy/canopy.fs @@ -52,11 +52,12 @@ type BrowserStartMode = | Chrome | ChromeWithOptions of Chrome.ChromeOptions | ChromeWithOptionsAndTimeSpan of Chrome.ChromeOptions * TimeSpan + | PhantomJS let firefox = Firefox let ie = IE let chrome = Chrome - +let phantomJS = PhantomJS let mutable browsers = [] @@ -510,6 +511,7 @@ let start b = //for ie you need to set Settings -> Advance -> Security Section -> Check-Allow active content to run files on My Computer* //also download IEDriverServer and place in c:\ or configure with ieDir //firefox just works + //for phantomjs download it and put in c:\ or configure with phantomJSDir browser <- match b with | IE -> @@ -528,6 +530,9 @@ let start b = new OpenQA.Selenium.Firefox.FirefoxDriver() :> IWebDriver | FirefoxWithProfile profile -> new OpenQA.Selenium.Firefox.FirefoxDriver(profile) :> IWebDriver + | PhantomJS -> + new OpenQA.Selenium.PhantomJS.PhantomJSDriver(phantomJSDir) :> IWebDriver + if autoPinBrowserRightOnLaunch = true then pin Right browsers <- browsers @ [browser] diff --git a/canopy/configuration.fs b/canopy/configuration.fs index ba553c30..496b2112 100644 --- a/canopy/configuration.fs +++ b/canopy/configuration.fs @@ -6,6 +6,7 @@ let failFast = ref false let mutable chromeDir = @"c:\" let mutable ieDir = @"c:\" +let mutable phantomJSDir = @"c:\" let mutable elementTimeout = 10.0 let mutable compareTimeout = 10.0 let mutable pageTimeout = 10.0 diff --git a/sampleprojectstructure/obj/Debug/sampleprojectstructure.fsproj.FileListAbsolute.txt b/sampleprojectstructure/obj/Debug/sampleprojectstructure.fsproj.FileListAbsolute.txt deleted file mode 100644 index f477f967..00000000 --- a/sampleprojectstructure/obj/Debug/sampleprojectstructure.fsproj.FileListAbsolute.txt +++ /dev/null @@ -1 +0,0 @@ -C:\projects\canopy\sampleprojectstructure\obj\Debug\sampleprojectstructure.fsprojResolveAssemblyReference.cache diff --git a/sampleprojectstructure/obj/Debug/sampleprojectstructure.fsprojResolveAssemblyReference.cache b/sampleprojectstructure/obj/Debug/sampleprojectstructure.fsprojResolveAssemblyReference.cache deleted file mode 100644 index 0945dd71..00000000 Binary files a/sampleprojectstructure/obj/Debug/sampleprojectstructure.fsprojResolveAssemblyReference.cache and /dev/null differ