gulp-protractor-qa
gulp-protractor-qa copied to clipboard
Handle any form of denormalized directives
According to the official documentation, Angular allows the following:
<span ng-bind="name"></span>
<span ng:bind="name"></span>
<span ng_bind="name"></span>
<span data-ng-bind="name"></span>
<span x-ng-bind="name"></span>
Currently, only ng-
and data-ng-
are supported. (https://github.com/ramonvictor/gulp-protractor-qa/blob/master/lib/find-view-matches.js#L55)
Reference: https://docs.angularjs.org/guide/directive#normalization
I'm working on it now! Thanks for your contributions, @stramel! Very welcome! :)
Just an update on this, selectors with :
don't seem to be supported by cheerio. I get this error:
SyntaxError: Malformed attribute selector: ng:repeat="
When I remove ng:
option all works fine. Thus, I'm not including ng:
variation for now.
I'm wondering if there would be a way to wildcard match the attribute and strip off the ng:
, ng-
, ng_
and everything before the ng
. That would cover all cases but I'm not sure if it would be possible to look for an attribute containing bind
694c2f74ad84fbd167536f9198b567f09a63b2b5 should cover all prefixes, except ng:
.
I know what you mean, I'll think about it later. I want to focus on publishing this refactored version first.
I agree, it would be good to get this out.
@ramonvictor Thoughts?
Using the Cheerio Plugins to create a different find method that strips the prefixes.
@stramel that sounds a good approach. I'll take a look on it soon. Thanks for one more nice suggestion.