-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PhantomJS support #94
Comments
I will add it tonight. I played with it some at work and it does not support javascript alerts, just an fyi. |
Awesome! ⛵ We are so past using javascript alerts. In fact it is verboten. 🇩🇪 |
This will be released in a new build tonight. Simply use 'start phantomJS' instead of 'start chrome'. I tested it with my basic test suite build for canopy regression testing and it worked fine as long as I skipped tests with alerts in them. The test suite was a little smaller that normal and ran in 70 seconds with phantomJS 1.9.x, Chrome ran the full suite in 59 seconds. So if you want speed chrome is the way to go. If you want headless then you can use this powershell trick I figured out (you have to turn on powershell locally with Set-ExecutionPolicy, google it): Start-Service winrm
Enable-PSRemoting -force
The lines in the middle are comented with #. You may need that uncommented if it complaines about your network adapters being public? Happened to me I think because of vmware network adapters. Last line change it to be the path to your tests. Its a cool trick you can use for anything, run it remotely on your own pc =). Unfortunately this doesn't work with chrome, I think its because chromedriver cant launch an instance of chrome. It does work with Firefox and provides the same experience as phantom would. |
Now available in canopy 0.8.0 |
https://gist.github.com/lefthandedgoat/6381311 That basic sampled worked for me with phantomJS. Looking at the screenshot, I found this on stack overflow: |
I am clearing localstorage so that seems like it may not be supported. Taking out that js call makes all my tests run. I am seeing
Created my own browser like so: let service = OpenQA.Selenium.PhantomJS.PhantomJSDriverService.CreateDefaultService(canopy.configuration.phantomJSDir)
service.ProxyType <- "none"
let b = new OpenQA.Selenium.PhantomJS.PhantomJSDriver(service) :> OpenQA.Selenium.IWebDriver
canopy.core.browser <- b
canopy.core.browsers <- browsers @ [browser]
Moar dataSince PhantomJS seems slow at network requests and we use RequireJS and have a lot of network traffic for unoptimized versions of our site I wanted to compare the two leaders against our optimized production version:
|
Updated Chrome numbers above 👍 |
This weekend I will provide some more options for starting phantomJS with no proxy and the pull request you sent. Thanks! |
canopy 0.8.1 is available on nuget with the above commit and your pull request. |
Cool thanks. I'll try it out and close this issue. If I run into problems I'm sure you'll hear from me. ⛵ |
My hope is to have a subset of my UI tests as part of our check-in test pass. Seems like WebDriver now supports PhantomJS. How hard would it be to add support for this as a browser type? I believe it is similar to Chrome Driver in that there needs to be an .exe runnable from a known path.
The text was updated successfully, but these errors were encountered: