1

Protractor seems to be the buzzword these days for automating Web pages built with Angular JS. Are there any other frameworks other than Protractor specifically built for testing Angular web apps?

3

I suppose you can look at tools that were not created specifically for Angular but convenient for Angular web apps testing. I've tried to use TestCafe for testing Angular web apps to compare it with Protractor and it was comfortable. TestCafe api has Selectors, it helps to create useful page model for Angular web apps tests.

For example, you call replace this code in Protractor test

var user = element(by.model("user"));

user.getAttribute('value').then(function (value) {
    console.log(value);
});

with this TestCafe test code

const user = Selector('[ng-model=user]');

console.log(await user.value);

Or create angular-specific page model object:

const byModel = model => Selector(`[ng-model=${model}]`);

const page = {
    user: byModel('user')
}

console.log(await page.user.value);

I've posted this example just to show that not Angular-based testing tools can be useful for testing Angular apps.

UPDATE: Now TestCafe Team provides Selector extensions that make it easier to test Angular applications with TestCafe. These extensions allow you to create a Selector to find elements on the page in a way that is native to Angular applications.

2

There are plenty of frameworks and libraries. But too much depend of the level of testing you want to achive.
- Nightwatch
- Webdrive
- Nigthmarejs
- Cucumber
- Karma, Mocha, Chai, PhantomJs (personally I use this stack).
- Ava
- Tape
- Node-tap

Just to mention some frameworks.

  • geb - gebish.org (Groovy, Cucumber, WebDriver ...) – amar Nov 17 '16 at 14:04
  • 1
    WebDriver, Cucumber are not spefic to Angular apps. – dzieciou Dec 10 '16 at 20:57
1

Technically, NO. Protractor specific is, that protractor is synchronizing with the Angular app, so you do not need to implement waiting for each command and Protractor uses some of the Angular features.

On the other hand, you can test Angular apps by any testing framework as Angular app is yet another one web application. So whatever tool for web will succeed. You then would need to implement functions like waitTillElementIsPresent().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.