I am looking for guidance on how to write automation test scripts for a small AngularJs application using the cucumber-protractor-typescript framework. As someone new to Angular applications, I am particularly concerned about creating reliable locators.
Below is an example of the HTML code I am working with and need help writing a locator for a drop-down icon:
<span class="mat-expansion-indicator ng-tns-c22-597 ng-trigger ng-trigger-indicatorRotate ng-star-inserted" style="transform: rotate(1800deg);"></span>
My xpath locator looks like this:
expandedBrandIcon = element(by.xpath("//h2[contains(text(),'Brand')]/ancestor::mat-expansion-panel-header//span[contains(@style,'180deg')]