Question

How do you do a full stack testing of an nodejs/angularjs application. I have been having numerous issues with zombiejs where the tests intermittently fail and pass.

I want tests that simulate user's interactions (like capybara for rails or zombie for nodejs).

The test should be of the form (writing it like cucumber tests):

  1. I go to the /login page
  2. I fill in email "test@user.com"
  3. I fill in password "secret"
  4. I click submit
  5. I should be on /users page

Are there any frameworks that can help me right full stack tests for angular applications?

Was it helpful?

Solution

Have you looked at Karma? The Github source for the project is here. I find Karma an excellent tool for both unit and testing an application in a real word scenario. Karma has Angular Scenario Runner e2e testing (ngScenario) that simulates user interactions and might meet your needs. It also "understands" AngularJS and can make testing AngularJS apps easier. For example, you can write tests such as the following (from the AngularJS docs):

describe('Buzz Client', function() {
  it('should filter results', function() {
    input('user').enter('jacksparrow');
    element(':button').click();
    expect(repeater('ul li').count()).toEqual(10);
    input('filterText').enter('Bees');
    expect(repeater('ul li').count()).toEqual(1);
  });
});

to navigate to pages, fill in input boxes (like email and passwords), click submit buttons, etc. and verify the entire application works as expected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top