Docs: relationship with Karma
I'm not sure if Protractor is intended to to be used with, in addition to, or instead of Karma.
Maybe a few words in the Readme would be helpful?
Definitely - we'll be moving E2E tests from Angular examples over at some point and will definitely clarify then.
Can you give a few pointers on how to get going with it? I mean, in terms of running tests, we can check out the samples but I don't see much in way of configuring Karma for Protactor
Protractor and Karma should not be used together; instead they provide separate systems for running tests. Protractor and Karma cover different aspects of testing - Karma is intended mostly for unit tests, while Protractor should be used for end to end testing.
Protractor is built on top of WebDriverJS, which uses a Selenium/WebDriver server to provision browsers and drive test execution. Examples of pure WebDriverJS can be found here: http://code.google.com/p/selenium/wiki/WebDriverJs
Just an idea (not from me actually, https://github.com/karma-runner/karma/issues/542): Use WebDriver to start the browser for karma. That could be a nice feature for Protractor, what do you think?
Tobias
Hm, I thought you may be making efforts to combine them, as runners.
Some more questions (let me know if there's a better avenue for them than this issues page):
- Will you be making efforts to simplify assertions (without complex .then() callbacks) like the E2E scenario had?
- I'm in two minds on whether to use protractor in JS or port it to .NET so I can write my tests in C#. If I decide to do so - what would be the best way to keep the two repositories in sync, other than manually checking your check-ins every so often?
Tobias - I'm not sure exactly what feature you're proposing. The setup at the moment already does launch browsers using WebDriver.
I do plan to include scripts to help download the selenium standalone server and chromedriver, which should make it easier to get started with protractor.
Georgios - I think it makes sense to keep Protractor and Karma separate - for end to end tests, you want the native event driving and flexibility of webdriver, while for unit tests you want fast execution and autowatching of files.
I'm actually currently at work on simpler assertions which understand promises!
I have no current plans to port to .NET, but I will be porting to Java at some point. I haven't yet figured out the method for keeping repositories in sync, but I will definitely document the process once it's worked out.
That's great!
Looking at your code it won't be as simple as I thought. Not sure how easily I can access element.data() from the C# WebDriver.
Where do I have to put chromedriver.exe for this to run? I tried setting capabilities['chrome.binary'] to no avail.
Also, do you have a roadmap on the project? If so, please share
I'm on windows!
Accessing element.data() shouldn't be any different in C# than in node.js, since it's done through executeScriptAsync. (C# docs: http://selenium.googlecode.com/svn/trunk/docs/api/dotnet/html/M_OpenQA_Selenium_IJavaScriptExecutor_ExecuteAsyncScript.htm)
I have chromedriver in the same directory as the selenium standalone binary, but I am on a mac so no guarantees for windows.
I'm hoping to use issues to track my roadmap, but don't have much laid our yet :)
EDIT: Where to put ChromeDriver on various systems: https://code.google.com/p/selenium/wiki/ChromeDriver
Still doesn't wanna play nice :S Any further ideas, let me know.
Thanks for pointing that out - this may actually be viable. I'll keep you posted on the port if I go ahead.
I thought about something like starting karma from protractor command line interface and then make karma use the same webdriver configuration as protractor. I think usually what you want in a CI is to run your end2end and unit tests against the same browsers. If you add further scripts to e.g. download and start the webdriver server automatically, this could then be also used for running the karma tests. But I am not sure about how much benefit this would be...
Georgios - does this work for you?
java -jar selenium-server-standalone-2.33.0.jar -Dwebdriver.chrome.driver=./chromedriver
I've opted to go with WebDriver in C# after all (copying all your wonderful clientSideScripts :)) - perhaps this can help anyone searching for the same problem
I am also curious as to why protractor would not be built off of karma?
@jperl WebDriver provides native event firing, which allows you to test the application truly as a user would. There's also active work on WebDriver to update it to do native event firing on mobile browsers. Karma, on the other hand, loads code into an iframe, which is great for unit testing but doesn't truly interact with the site in the way a user would.
@juliemr is there support for PhantomJS/SlimerJS with Protractor?
@johnjelinek No direct support. I'm not sure what the use case for end to end tests with PhantomJS would be - certainly that's not how your users are interacting with your page. As far as I know, the only advantage of PhantomJS is that it's fast, and while fast end2end tests are better, performance isn't the same kind of issue that it is for unit tests. Is there another reason to test with it?
That said, there is this thing: https://github.com/detro/ghostdriver
so potentially, you could hook PhantomJS up to your selenium server and use it.
In my scenario, the continuous integration server doesn't have xserver and so a headless browser, based on webkit/gecko (phantom/slimer), should suffice to make sure everything is working in terms of smoke tests. On Aug 22, 2013 5:39 PM, "Julie Ralph" [email protected] wrote:
@johnjelinek https://github.com/johnjelinek No direct support. I'm not sure what the use case for end to end tests with PhantomJS would be - certainly that's not how your users are interacting with your page. As far as I know, the only advantage of PhantomJS is that it's fast, and while fast end2end tests are better, performance isn't the same kind of issue that it is for unit tests. Is there another reason to test with it?
That said, there is this thing: https://github.com/detro/ghostdriver
so potentially, you could hook PhantomJS up to your selenium server and use it.
— Reply to this email directly or view it on GitHubhttps://github.com/angular/protractor/issues/9#issuecomment-23131698 .
Closing this thread as I think everything has been addressed. Please open new issues if anything is lingering!