Markup validation when page is generated with AngularJS Markup validation when page is generated with AngularJS selenium selenium

Markup validation when page is generated with AngularJS


With AngularJS Your should NOT have to do validate every variation of your page as DOM changes with script in your Single Page Application as long as you stick with AngularJS programming model and stick to the following:-

  1. Validate every HTML file/fragment.

    These are Angular templates/partials OR any HTML files you may have (index.html).Use grunt based html validator plugins like this so that grunt workflow can ensure that the HTML is valid even before it is committed in to your source code repository. Such plugins can validate HTML fragments.

  2. Use built-in AngularJS directives to manipulate the DOM.

    e.g. ngSwitch, ngView, ngIf etc. instead of any custom stuff using jQuery or other mechanism.

    AngularJS already ensures a valid HTML DOM. That means your resulting HTML is always going to be valid.


Have you consider using Angular e2e:

http://docs.angularjs.org/guide/dev_guide.e2e-testing

This allows you access to get/validate elements from html like:

expect(element('#email').html()).toBe('something');

From Angular Documentation using jazmine:

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);});

});

Update 1

Then you can try something like:


I call this GUI level Testing. Visual Studio has an excellent browser recording and playback tool, which allow a tester to create Automated tests which validate anything the tester wants.

Here's a video: https://onedrive.live.com/?cid=ae5cd7309cccc43c&id=AE5CD7309CCCC43C%21183&sff=1&authkey=%21ANqaLtCZbtJrImU&v=3

You'll need to have the Premium edition to do this. In addition, I've heard good reports about Selenium, in fact, MSFT themselves have endorsed it.