How do I check all checkboxes in this page using protractor ?
I tried to access the elements this way but doesn't seem to be working.
select = element(by.cssContainingText('mat-card-title', 'Classifications'))
.all(by.css('mat-pseudo-checkbox'));

Your approach does not work because
mat-card-titledoes not have any child elements. When chainingelement()calls, it always only searches for child elements.For selecting the correct elements, we have to take the parent
mat-cardand filter it byby.cssContainingText().After filtering we have to locate the
mat-pseudo-checkboxelements and send a click to these underlying elements.That can be achieved as follows:
Ressources
Protractor CheatSheet:
General Style guide for protractor => https://github.com/CarmenPopoviciu/protractor-styleguide
Cheat-sheet => https://gist.github.com/javierarques/0c4c817d6c77b0877fda
As your test suite grows, you should consider using the
Page Object ModelPattern for your tests. We use it for our tests and it's a great pattern for separating test logic. => https://www.thoughtworks.com/insights/blog/using-page-objects-overcome-protractors-shortcomings