cvn / angular-shims-placeholder

Angular directive to emulate the placeholder attribute on text and password input fields for old browsers, such as IE9, IE8, and IE7. Also works on textareas and html5 input types.
MIT License
63 stars 26 forks source link

Add protractor E2E tests #32

Open evilaliv3 opened 8 years ago

evilaliv3 commented 8 years ago

It would be valuable that being a library written for angular, unit tests would be rewritten using protractor.

In addition by means of grunt-protractor-runner it would be valuable to interconnect unit tests to saucelabs in order to automatize browser testing; saucelabs infact offer free accounts for opensource projects like angular-shims-placeholder

I'm writing this while integrating the library in GlobaLeaks https://github.com/globaleaks/GlobaLeaks/issues/1533, that has a complete unit testing in place like the one i'm describing and where the library appear to not work properly.

From what i'm testing manually it works great but it seems to cause protractor detecting angularjs startup and this may lie some bugs: https://api.travis-ci.org/jobs/97890200/log.txt?deansi=true

cvn commented 8 years ago

Hi @evilaliv3,

I followed some of your links and I'm not sure why the protractor tests are failing. I don't have much experience with protractor.

As a workaround, you can try disabling the shim as part of the test pre-run. Do this by overriding the hasPlaceholder method of the placeholderSniffer service to always return true. Something like this:

myApp.run(function (placeholderSniffer) {
    placeholderSniffer.hasPlaceholder = function () { return true; }
});

And as for you request to add protractor tests, there are no plans to do this. I would be glad to offer assistance if you or anyone else wants to tackle it.

evilaliv3 commented 8 years ago

thanks for the suggestion @cvn! really appreciated.