Comments (39)
Definitely - we'll be moving E2E tests from Angular examples over at some point and will definitely clarify then.
from protractor.
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
from protractor.
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
from protractor.
Just an idea (not from me actually, karma-runner/karma#542): Use WebDriver to start the browser for karma. That could be a nice feature for Protractor, what do you think?
Tobias
from protractor.
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?
from protractor.
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.
from 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.
from protractor.
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
from protractor.
I'm on windows!
from protractor.
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
from protractor.
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.
from protractor.
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...
from protractor.
Georgios - does this work for you?
java -jar selenium-server-standalone-2.33.0.jar -Dwebdriver.chrome.driver=./chromedriver
from protractor.
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
from protractor.
I am also curious as to why protractor would not be built off of karma?
from protractor.
@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.
from protractor.
@juliemr is there support for PhantomJS/SlimerJS with Protractor?
from 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.
from protractor.
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//issues/9#issuecomment-23131698
.
from protractor.
Closing this thread as I think everything has been addressed. Please open new issues if anything is lingering!
from protractor.
@johnjelinek fyi you can just run phantomjs --webdriver=4444
, and it will act as a webdriverjs server (on port 4444).
from protractor.
I'll try this out!
On Sep 24, 2013 7:34 PM, "Jared Forsyth" [email protected] wrote:
@johnjelinek https://github.com/johnjelinek fyi you can just run phantomjs
--webdriver=4444, and it will act as a webdriverjs server (on port 4444).—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-25054243
.
from protractor.
can we use protractor for unit testing? I think not but just need confirmation from experts out there..
from protractor.
You 'could', but it's the won't tool for the job. Use karma as your test
runner.
On Oct 10, 2013 1:21 AM, "Atul" [email protected] wrote:
can we use protractor for unit testing? I think not but just need
confirmation from experts out there..—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-26031510
.
from protractor.
Yup - Karma is a great tool for unit testing, and you should use that.
from protractor.
Because this question comes up so frequently (not just here, but in my office, at meetups, etc) - would it be possible to say something about Karma in the Protractor readme?
For example:
Tool | Purpose | What sets it apart | Example Usage |
---|---|---|---|
Protractor | End-to-End | Has knowledge of the whole page, not individual modules. | Create account, buy a widget, sign out. Did it work as I expected? |
Karma | Unit | You choose what modules or files to make available to test. It does not know about the whole page. | When I pass various values to this service do I get the output I expected? |
Disclaimer: I haven't used Protractor yet and I'm still new with Karma.
from protractor.
I'll add something to the FAQ.
from protractor.
Thanking everyone for their feedback.
I like using Karma for Unit testing and I love protractor for end to end testing but can we make protractor work for unit testing because if we can do that we will be removing dependency on karma and then for testing we just have to use protractor. Just a thought..
Regards,
Atul
from protractor.
They should be separate.
On Oct 10, 2013 5:52 PM, "Atul" [email protected] wrote:
Thanking everyone for their feedback.
I like using Karma for Unit testing and I love protractor for end to end
testing but can we make protractor work for unit testing because if we can
do that we will be removing dependency on karma and then for testing we
just have to use protractor. Just a thought..Regards,
Atul—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-26098343
.
from protractor.
Yes, they should be separate systems. Karma is great for what it does!
from protractor.
@georgiosd I've started working on the .NET port: https://github.com/bbaia/protractor-net
Feedback is welcome
from protractor.
Hi @bbaia got bit excited to see your post.
What do I need to do to get this end to end test to work on ASP.Net MVC4 project.
IF i am not wrong all i have to do is to install protractor via nuget and then just start writing test case under test project?
Wait for ur reply.
Regards,
Atul Chaudhary
from protractor.
@bbaia Have you looked at https://github.com/TestStack/TestStack.Seleno at all?
I have some custom code that is a sort of hybrid between the two!
from protractor.
@atul221282 Yes, check out the sample.
@georgiosd Nope, but if you want to use the PageObjects pattern, Selenium provides a package (Selenium.Support) for that.
See also protractor's documentation: https://github.com/angular/protractor/blob/master/docs/getting-started.md#organizing-real-tests-page-objects
from protractor.
Has anyone here gotten E2E tests to run with PhantomJS? Would you be able to share your setup on this thread? #189 Thanks.
from protractor.
Once there's a process it seems like one of the MD docs should be updated with how to get PhantomJS running so the insights aren't hidden away in these forums. Better yet, it may be worth integrating directly into Protractor like Karma did - imho.
from protractor.
I'd be happy to accept a pull request with docs on how to use PhantomJS!
from protractor.
Sorry, meant to put that previous comment about MD docs on a different thread!
from protractor.
I using protractor to perform unit testing.. I am getting error if use expect function like below. Please advice is highly appreciated.
element(by.model('ctrl.formData.emailAddress')).sendKeys('[email protected]');
var emailaddress = element(by.model('ctrl.formData.emailAddress'));
expect(emailaddress.getText()).toEqual('[email protected]');
error : Expected '' to equal '[email protected]'.
from protractor.
Related Issues (20)
- Problems with interacting with page elements after closing iframe on Chrome 94
- Twistlock security scan shows that private keys are stored in the container
- Support on Protractor after 2022 and any plans for licensed version HOT 7
- Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. HOT 4
- Callback function is taking long after completing the run in the protractor testcase
- [BUG] Upgrade transitive dependency "[email protected]" to fix CVE-2021-3918 HOT 1
- [BUG] input with dropdown use clear the selected tag won't remove, and click will click on the text not the element.
- Is protractor no longer working when using Angular 13? HOT 8
- protractor.Key.chord() broken in the latest chromedriver HOT 3
- Prototype Pollution in minimist
- qs version CVE-2021-44907 (High) detected in my repo dependencies
- need support for finding element under shadow root HOT 3
- Feature request - html to pdf
- Git.io deprecation notice
- Getting the ERROR "This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used." When I try to use restart() or close() method HOT 2
- Deprecated warning with Protractor HOT 2
- Interview partners for research about communication in GitHub projects wanted
- Can existing Protractor automation scripts developed in year 2020 supported on windows 2019 OS server
- webdriver Manager , chrome version higher then 114 HOT 3
- Migrate Protractor to Playwright
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protractor.