fix flaky add multiple owner (#22059)

This commit is contained in:
Dhruv Parmar 2025-07-02 22:17:27 +05:30 committed by GitHub
parent 4c1976409a
commit 07fc2fbfa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,6 +263,24 @@ export const addMultiOwner = async (data: {
{ state: 'detached' }
);
const isClearButtonVisible = await page
.locator("[data-testid='select-owner-tabs']")
.getByTestId('clear-all-button')
.isVisible();
// If the user is not in the Users tab, switch to it
if (!isClearButtonVisible) {
await page
.locator("[data-testid='select-owner-tabs']")
.getByRole('tab', { name: 'Users' })
.click();
await page.waitForSelector(
'[data-testid="select-owner-tabs"] [data-testid="loader"]',
{ state: 'detached' }
);
}
if (clearAll && isMultipleOwners) {
await page.click('[data-testid="clear-all-button"]');
}