最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Testing AngularJS application using Selenium and PhantomJS - Stack Overflow

programmeradmin4浏览0评论

I want to test my AngularJS application using Selenium and PhantomJS, but I am not finding an easy to start resource or video tutorial. Can you please suggest some good resource as a starting point.

I want to test my AngularJS application using Selenium and PhantomJS, but I am not finding an easy to start resource or video tutorial. Can you please suggest some good resource as a starting point.

Share Improve this question edited Sep 6, 2014 at 8:51 Artjom B. 62k26 gold badges135 silver badges230 bronze badges asked Feb 7, 2014 at 14:14 UtpalUtpal 8074 gold badges16 silver badges47 bronze badges 2
  • Do you want to do unit or e2e tests? As i am into all of this at the moment, I can send you good links. – glepretre Commented Feb 7, 2014 at 14:41
  • @glepretre I have to test if the website I have build is functioning properly and the flow are correct or not so i think it will be E2E testing.Please share those links. – Utpal Commented Feb 10, 2014 at 6:46
Add a ment  | 

2 Answers 2

Reset to default 3

Have you looked at this tutorial?

The tutorial itself seems decent. You might have to change some stuff depending on what you choose as your test-runner (this tutorial chose Mocha).

I'd also look at Karma and Protractor which are built by the AngularJS team. Protractor is targeted more towards end-to-end testing in AngularJS apps.

If you're set on Selenium, you could also look at Nightwatchjs which is also end-to-end and runs against a Selenium server but requires Node.js. Nightwatchjs could be pared to Protractor but seems like it has easier-to-understand syntax.

As @Nima-Vaziri said, you should have a look at Karma to run unit tests on your app. This article will help you on this way.

Then to run e2e tests, the new runner developped by the Angular team is Protractor and you can start with this demo : Protractor demo

To understand, these docs were very useful to me:

  • Protractor Readme
  • Setting up your browser
  • Getting started

If you're going to work with AngularJS: you definitely should know about eggehead.io videos! This one is about Protractor. But, there's a lot of video tutorials very interesting to teach you how to build an Angular app!

发布评论

评论列表(0)

  1. 暂无评论