Reputation: 438
I have a button I want to interact with on a page, but the button is apart of a parent element that houses all other buttons and elements on the page.
Every time playwright attempts to interact with this button I get a
<app-content-view _nghost-vtf-c377="" class="ng-tns-c377-5 ng-star…>…</app-content-view> intercepts pointer events
which is the parent at the very top of the html tree.
And Im confused why this is happening all of a sudden? The test was working fine before, and after using the repeat-each flag a number of times while I was debugging it started having this issue.
Just to add the element app-content-view
is not supposed to disappear and it contains other elements on the page which playwright can interact with just fine because all other tests are passing.
Some additional information:
A few other people in my org have cloned the repo and when they run the test it works for them with no issue.
I guess my question is how is this happening all of a sudden there have been no code changes on the front end to cause this, and it works fine for others, and how do I fix it/prevent this from happening.
The code being ran is here:
async openManager() {
await this.managerButton.click();
await expect(this.managerDrawer).toBeVisible();
}
this function is called here:
await managerActions.openManager();
the locator is right here:
this.managerButton = page.locator('//mat-icon[contains(text(),"manager")]');
Upvotes: 2
Views: 6440
Reputation: 438
Not sure if this was the root cause of the issue but i changed the selector to a CSS selector and not an xpath one and it fixed the issue.
I also had to fully restart my computer, delete the old test folder and clone the repo in the new folder.
ran the test 120 times and it passed every run.
Again not sure if what I did was related but I seem to be having consistent results now.
Upvotes: 3