In Protractor, there are $
and $$
convenient shortcuts for CSS selectors:
$(".myclass") // means: element(by.css(".myclass"))
$$(".myclass") // means: element.all(by.css(".myclass"))
Is it possible to introduce custom shortcuts for other locators?
To be more specific, what if we want to have a $r
and $$r
shortcuts for "by repeater" calls. To be able to write:
$r("item in items")
$$r("item in items")
instead of:
element(by.repeater("item in items"))
element.all(by.repeater("item in items"))