-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(clientSideScripts): Add by.buttonText, by.partialButtonText #455
Conversation
Automated CLA checker says: please sign CLA at http://code.google.com/legal/individual-cla-v1.0.html Please make sure that the email associated with your PR is the same as the email you use to sign. |
Done! |
CLA signature found, thank you! |
Big fan of this locator strategy @Damiya Thanks! |
I pulled this. Worked well on Chrome but failed on Firefox 26 (latest)
Are protractor specs being tested against Firefox in Sauce Labs-TravisCI? |
Hey Leo, On 1/26/2014 10:44 AM, Leo Gallucci wrote:
|
This is awesome! Thanks @Damiya |
Can you add support for input type="button" and input type="submit"? by.addLocator('buttonText', function(parentElement, buttonText) {
var using = parentElement || document,
buttons = using.querySelectorAll(
'button, input[type="button"], input[type="submit"]');
return Array.prototype.filter.call(buttons, function(button) {
var textContent = button.textContent;
return textContent && textContent.trim() === buttonText;
});
}); |
Thanks for your work on this - I'll accept if the cross-browser issues are fixed and the support that andres mentioned. |
Adds client side JS implementations of by.buttonText and by.partialButtonText, enabling element lookup based on innerText. Closes angular#452
PR updated, tested against IE11, Firefox 26, Chrome 33 locally. Added the input searchers as well. |
This is great @Damiya ! Just pulled & tested |
Glad to hear it
|
Thanks! Added a couple semicolons and merged as 88a1e58 |
Adds client side JS implementations of by.buttonText and
by.partialButtonText, enabling element lookup based on innerText.
Closes #452