Skip to content

Commit 067b51b

Browse files
committed
Less flaky document test #715
1 parent 19fc035 commit 067b51b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

browser/e2e/tests/test-utils.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ export const sideBarDriveSwitcher = '[title="Open Drive Settings"]';
2727
export const sideBarNewResource = '[data-test="sidebar-new-resource"]';
2828
export const currentDriveTitle = '[data-test=current-drive-title]';
2929
export const publicReadRightLocator = (page: Page) =>
30-
page.locator('[data-test="right-public"] input[type="checkbox"]').first();
30+
page
31+
.locator(
32+
'[data-test="right-public"] input[type="checkbox"]:not([disabled])',
33+
)
34+
.first();
3135
export const contextMenu = '[data-test="context-menu"]';
3236
export const addressBar = '[data-test="address-bar"]';
3337
export const newDriveMenuItem = '[data-test="menu-item-new-drive"]';
@@ -111,7 +115,10 @@ export async function makeDrivePublic(page: Page) {
111115
await page.click(currentDriveTitle);
112116
await page.click(contextMenu);
113117
await page.click('button:has-text("share")');
114-
await expect(publicReadRightLocator(page)).not.toBeChecked();
118+
await expect(
119+
publicReadRightLocator(page),
120+
'The drive was public from the start',
121+
).not.toBeChecked();
115122
await publicReadRightLocator(page).click();
116123
await page.locator('text=Save').click();
117124
await expect(page.locator('text="Share settings saved"')).toBeVisible();

0 commit comments

Comments
 (0)