I'm a bit confused about the purposes of the $ and $$ commands. I initially thought they were just substitutes for 'by.css', but why use $$?
<element id = "eId"></element>
Based on the example above, I assumed that these two lines are interchangeable:
element(by.css('#eId'));
and
element($('#eId'));
However, the first line works while the second one doesn't. So what sets them apart?
The documentation doesn't offer much clarity. It suggests that "$" is mainly used for chaining, like
element(by.css('#eId')).element($('#childId'));
, which means "Select the first element, then select the second element within the first.' Nevertheless, there are instances where $ is used to select the initial element.
With all that said, it boils down to one question: "What makes by.css, $, and $$ different from each other?"