- Removed 'feature/doc-dnd' branch from the Docker Hub workflow to streamline deployment processes. - Updated document creation tests to replace 'New page' button references with 'New doc' for consistency. - Enhanced test cases to improve clarity and ensure accurate verification of document functionalities. - Added new utility function for creating root subpages, improving test maintainability.
59 lines
2.1 KiB
TypeScript
59 lines
2.1 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
import { createDoc, verifyDocName } from './common';
|
|
import { updateShareLink } from './share-utils';
|
|
import { createRootSubPage } from './sub-pages-utils';
|
|
|
|
test.describe('Inherited share accesses', () => {
|
|
test('it checks inherited accesses', async ({ page, browserName }) => {
|
|
await page.goto('/');
|
|
const [parentTitle] = await createDoc(page, 'root-doc', browserName, 1);
|
|
|
|
// Wait for and intercept the POST request to create a new page
|
|
await createRootSubPage(page, browserName, 'sub-page');
|
|
|
|
await page.getByRole('button', { name: 'Share' }).click();
|
|
await expect(
|
|
page.getByText('People with access via the parent document'),
|
|
).toBeVisible();
|
|
|
|
const user = page.getByTestId(
|
|
`doc-share-member-row-user@${browserName}.test`,
|
|
);
|
|
await expect(user).toBeVisible();
|
|
await expect(user.getByText('E2E Chromium')).toBeVisible();
|
|
await expect(user.getByText('Owner')).toBeVisible();
|
|
|
|
await page
|
|
.locator('.--docs--doc-inherited-share-content')
|
|
.getByRole('link')
|
|
.click();
|
|
|
|
await verifyDocName(page, parentTitle);
|
|
});
|
|
});
|
|
|
|
test.describe('Inherited share link', () => {
|
|
test('it checks if the link is inherited', async ({ page, browserName }) => {
|
|
await page.goto('/');
|
|
// Create root doc
|
|
await createDoc(page, 'root-doc', browserName, 1);
|
|
|
|
// Update share link
|
|
await page.getByRole('button', { name: 'Share' }).click();
|
|
await updateShareLink(page, 'Connected', 'Reading');
|
|
await page.getByRole('button', { name: 'OK' }).click();
|
|
|
|
// Create sub page
|
|
await createRootSubPage(page, browserName, 'sub-page');
|
|
|
|
// // verify share link is restricted and reader
|
|
await page.getByRole('button', { name: 'Share' }).click();
|
|
// await expect(page.getByText('Inherited share')).toBeVisible();
|
|
const docVisibilityCard = page.getByLabel('Doc visibility card');
|
|
await expect(docVisibilityCard).toBeVisible();
|
|
await expect(docVisibilityCard.getByText('Connected')).toBeVisible();
|
|
await expect(docVisibilityCard.getByText('Reading')).toBeVisible();
|
|
});
|
|
});
|