Looking to implement browser.wait() specifically for waiting on a particular element. Need some guidance with this task.
Situation -> When a filter div is clicked, a hidden div becomes visible. Need to wait until it appears.
Before Click -
<div id = "collapseGenericFilter" class="pannel-collapse collapse">
After Click -
<div id="collapseGenericFilter" class="pannel-collapse collapse in">
Is there a way to use browser.wait based on the ID of an element, waiting until a specific class selector is visible?
I'm addressing this by using
browser.wait(() => element(by.css('.panel-collapse.collapse.in')).isPresent(),
500,
'long wait');
Does this approach seem correct? I would prefer locating the DOM element first by its ID then proceeding with the class like
element('GenericFilter').by.css('panel-collapse collapse in') etc.
Note:- I'm quite new to web technologies, so please pardon me if this seems like a basic question as I am still learning.
Thank you in advance