(frontend) adapt all tests related to the new header

Since we no longer use an editable div but an input, we must
modify the tests accordingly
This commit is contained in:
Nathan Panchout
2024-11-25 12:10:16 +01:00
committed by Anthony LC
parent d5670640f5
commit 3a738fe701
9 changed files with 103 additions and 137 deletions

View File

@@ -40,14 +40,21 @@ export const createDoc = async (
}) })
.click(); .click();
await page.getByRole('heading', { name: 'Untitled document' }).click(); const input = page.getByRole('textbox', { name: 'doc title input' });
await page.keyboard.type(randomDocs[i], { delay: 100 }); await input.click();
await page.getByText('Created at ').click(); await input.fill(randomDocs[i]);
await input.blur();
} }
return randomDocs; return randomDocs;
}; };
export const verifyDocName = async (page: Page, docName: string) => {
const input = page.getByRole('textbox', { name: 'doc title input' });
await expect(input).toBeVisible();
await expect(input).toHaveText(docName);
};
export const addNewMember = async ( export const addNewMember = async (
page: Page, page: Page,
index: number, index: number,

View File

@@ -2,7 +2,7 @@ import path from 'path';
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { createDoc } from './common'; import { createDoc, verifyDocName } from './common';
const config = { const config = {
CRISP_WEBSITE_ID: null, CRISP_WEBSITE_ID: null,
@@ -129,7 +129,8 @@ test.describe('Config', () => {
browserName, browserName,
1, 1,
); );
await expect(page.locator('h2').getByText(randomDoc[0])).toBeVisible();
await verifyDocName(page, randomDoc[0]);
const webSocket = await webSocketPromise; const webSocket = await webSocketPromise;
expect(webSocket.url()).toContain('ws://localhost:8083/collaboration/ws/'); expect(webSocket.url()).toContain('ws://localhost:8083/collaboration/ws/');

View File

@@ -2,7 +2,12 @@ import path from 'path';
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { createDoc, goToGridDoc, mockedDocument } from './common'; import {
createDoc,
goToGridDoc,
mockedDocument,
verifyDocName,
} from './common';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('/'); await page.goto('/');
@@ -98,7 +103,7 @@ test.describe('Doc Editor', () => {
}); });
const randomDoc = await createDoc(page, 'doc-editor', browserName, 1); const randomDoc = await createDoc(page, 'doc-editor', browserName, 1);
await expect(page.locator('h2').getByText(randomDoc[0])).toBeVisible(); await verifyDocName(page, randomDoc[0]);
let webSocket = await webSocketPromise; let webSocket = await webSocketPromise;
expect(webSocket.url()).toContain( expect(webSocket.url()).toContain(
@@ -153,7 +158,7 @@ test.describe('Doc Editor', () => {
}) => { }) => {
const randomDoc = await createDoc(page, 'doc-markdown', browserName, 1); const randomDoc = await createDoc(page, 'doc-markdown', browserName, 1);
await expect(page.locator('h2').getByText(randomDoc[0])).toBeVisible(); await verifyDocName(page, randomDoc[0]);
const editor = page.locator('.ProseMirror'); const editor = page.locator('.ProseMirror');
await editor.click(); await editor.click();
@@ -178,7 +183,7 @@ test.describe('Doc Editor', () => {
}) => { }) => {
// Check the first doc // Check the first doc
const [firstDoc] = await createDoc(page, 'doc-switch-1', browserName, 1); const [firstDoc] = await createDoc(page, 'doc-switch-1', browserName, 1);
await expect(page.locator('h2').getByText(firstDoc)).toBeVisible(); await verifyDocName(page, firstDoc);
const editor = page.locator('.ProseMirror'); const editor = page.locator('.ProseMirror');
await editor.click(); await editor.click();
@@ -187,7 +192,8 @@ test.describe('Doc Editor', () => {
// Check the second doc // Check the second doc
const [secondDoc] = await createDoc(page, 'doc-switch-2', browserName, 1); const [secondDoc] = await createDoc(page, 'doc-switch-2', browserName, 1);
await expect(page.locator('h2').getByText(secondDoc)).toBeVisible(); await verifyDocName(page, secondDoc);
await expect(editor.getByText('Hello World Doc 1')).toBeHidden(); await expect(editor.getByText('Hello World Doc 1')).toBeHidden();
await editor.click(); await editor.click();
await editor.fill('Hello World Doc 2'); await editor.fill('Hello World Doc 2');
@@ -197,7 +203,7 @@ test.describe('Doc Editor', () => {
await goToGridDoc(page, { await goToGridDoc(page, {
title: firstDoc, title: firstDoc,
}); });
await expect(page.locator('h2').getByText(firstDoc)).toBeVisible(); await verifyDocName(page, firstDoc);
await expect(editor.getByText('Hello World Doc 2')).toBeHidden(); await expect(editor.getByText('Hello World Doc 2')).toBeHidden();
await expect(editor.getByText('Hello World Doc 1')).toBeVisible(); await expect(editor.getByText('Hello World Doc 1')).toBeVisible();
}); });
@@ -208,7 +214,7 @@ test.describe('Doc Editor', () => {
}) => { }) => {
// Check the first doc // Check the first doc
const [doc] = await createDoc(page, 'doc-saves-change', browserName, 1); const [doc] = await createDoc(page, 'doc-saves-change', browserName, 1);
await expect(page.locator('h2').getByText(doc)).toBeVisible(); await verifyDocName(page, doc);
const editor = page.locator('.ProseMirror'); const editor = page.locator('.ProseMirror');
await editor.click(); await editor.click();
@@ -219,7 +225,7 @@ test.describe('Doc Editor', () => {
nthRow: 2, nthRow: 2,
}); });
await expect(page.locator('h2').getByText(secondDoc)).toBeVisible(); await verifyDocName(page, secondDoc);
await goToGridDoc(page, { await goToGridDoc(page, {
title: doc, title: doc,
@@ -233,8 +239,9 @@ test.describe('Doc Editor', () => {
test.skip(browserName === 'webkit', 'This test is very flaky with webkit'); test.skip(browserName === 'webkit', 'This test is very flaky with webkit');
// Check the first doc // Check the first doc
const [doc] = await createDoc(page, 'doc-quit-1', browserName, 1); const doc = await goToGridDoc(page);
await expect(page.locator('h2').getByText(doc)).toBeVisible();
await verifyDocName(page, doc);
const editor = page.locator('.ProseMirror'); const editor = page.locator('.ProseMirror');
await editor.click(); await editor.click();

View File

@@ -3,7 +3,7 @@ import cs from 'convert-stream';
import jsdom from 'jsdom'; import jsdom from 'jsdom';
import pdf from 'pdf-parse'; import pdf from 'pdf-parse';
import { createDoc } from './common'; import { createDoc, verifyDocName } from './common';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('/'); await page.goto('/');
@@ -20,7 +20,7 @@ test.describe('Doc Export', () => {
return download.suggestedFilename().includes(`${randomDoc}.pdf`); return download.suggestedFilename().includes(`${randomDoc}.pdf`);
}); });
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible(); await verifyDocName(page, randomDoc);
await page.locator('.ProseMirror.bn-editor').click(); await page.locator('.ProseMirror.bn-editor').click();
await page.locator('.ProseMirror.bn-editor').fill('Hello World'); await page.locator('.ProseMirror.bn-editor').fill('Hello World');
@@ -57,7 +57,7 @@ test.describe('Doc Export', () => {
return download.suggestedFilename().includes(`${randomDoc}.docx`); return download.suggestedFilename().includes(`${randomDoc}.docx`);
}); });
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible(); await verifyDocName(page, randomDoc);
await page.locator('.ProseMirror.bn-editor').click(); await page.locator('.ProseMirror.bn-editor').click();
await page.locator('.ProseMirror.bn-editor').fill('Hello World'); await page.locator('.ProseMirror.bn-editor').fill('Hello World');
@@ -97,7 +97,7 @@ test.describe('Doc Export', () => {
await route.continue(); await route.continue();
}); });
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible(); await verifyDocName(page, randomDoc);
await page.locator('.bn-block-outer').last().fill('Hello World'); await page.locator('.bn-block-outer').last().fill('Hello World');
await page.locator('.bn-block-outer').last().click(); await page.locator('.bn-block-outer').last().click();

View File

@@ -6,6 +6,7 @@ import {
mockedAccesses, mockedAccesses,
mockedDocument, mockedDocument,
mockedInvitations, mockedInvitations,
verifyDocName,
} from './common'; } from './common';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -59,84 +60,31 @@ test.describe('Doc Header', () => {
const card = page.getByLabel( const card = page.getByLabel(
'It is the card information about the document.', 'It is the card information about the document.',
); );
await expect(card.locator('a').getByText('home')).toBeVisible();
await expect(card.locator('h2').getByText('Mocked document')).toBeVisible(); const docTitle = card.getByRole('textbox', { name: 'doc title input' });
await expect(card.getByText('Public')).toBeVisible(); await expect(docTitle).toBeVisible();
await expect(
card.getByText('Created at 09/01/2021, 11:00 AM'), await expect(card.getByText('Public document')).toBeVisible();
).toBeVisible();
await expect(card.getByText('Your role: Owner')).toBeVisible(); await expect(card.getByText('Owner ·')).toBeVisible();
await expect(page.getByRole('button', { name: 'Share' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Share' })).toBeVisible();
await expect(page.getByRole('button', { name: 'download' })).toBeVisible();
await expect(
page.getByRole('button', { name: 'Open the document options' }),
).toBeVisible();
}); });
test('it updates the title doc', async ({ page, browserName }) => { test('it updates the title doc', async ({ page, browserName }) => {
const [randomDoc] = await createDoc(page, 'doc-update', browserName, 1); await createDoc(page, 'doc-update', browserName, 1);
const docTitle = page.getByRole('textbox', { name: 'doc title input' });
await page.getByRole('heading', { name: randomDoc }).fill(' '); await expect(docTitle).toBeVisible();
await page.getByText('Created at').click(); await docTitle.fill('Hello World');
await docTitle.blur();
await expect( await verifyDocName(page, 'Hello World');
page.getByRole('heading', { name: 'Untitled document' }),
).toBeVisible();
});
test('it updates the title doc from editor heading', async ({ page }) => {
await page
.getByRole('button', {
name: 'New doc',
})
.click();
const docHeader = page.getByLabel(
'It is the card information about the document.',
);
await expect(
docHeader.getByRole('heading', { name: 'Untitled document', level: 2 }),
).toBeVisible();
const editor = page.locator('.ProseMirror');
await editor.locator('h1').click();
await page.keyboard.type('Hello World', { delay: 100 });
await expect(
docHeader.getByRole('heading', { name: 'Hello World', level: 2 }),
).toBeVisible();
await expect(
page.getByText('Document title updated successfully'),
).toBeVisible();
await docHeader
.getByRole('heading', { name: 'Hello World', level: 2 })
.fill('Top World');
await editor.locator('h1').fill('Super World');
await expect(
docHeader.getByRole('heading', { name: 'Top World', level: 2 }),
).toBeVisible();
await editor.locator('h1').fill('');
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(500);
await docHeader
.getByRole('heading', { name: 'Top World', level: 2 })
.fill(' ');
await page.getByText('Created at').click();
await expect(
docHeader.getByRole('heading', { name: 'Untitled document', level: 2 }),
).toBeVisible();
}); });
test('it deletes the doc', async ({ page, browserName }) => { test('it deletes the doc', async ({ page, browserName }) => {
const [randomDoc] = await createDoc(page, 'doc-delete', browserName, 1); const [randomDoc] = await createDoc(page, 'doc-delete', browserName, 1);
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible();
await page.getByLabel('Open the document options').click(); await page.getByLabel('Open the document options').click();
await page await page
@@ -193,16 +141,13 @@ test.describe('Doc Header', () => {
await goToGridDoc(page); await goToGridDoc(page);
await expect( await expect(page.getByRole('button', { name: 'download' })).toBeVisible();
page.locator('h2').getByText('Mocked document'),
).toHaveAttribute('contenteditable');
await page.getByLabel('Open the document options').click(); await page.getByLabel('Open the document options').click();
await expect(page.getByRole('button', { name: 'Export' })).toBeVisible();
await expect( await expect(
page.getByRole('button', { name: 'Delete document' }), page.getByRole('button', { name: 'Delete document' }),
).toBeHidden(); ).toBeDisabled();
// Click somewhere else to close the options // Click somewhere else to close the options
await page.click('body', { position: { x: 0, y: 0 } }); await page.click('body', { position: { x: 0, y: 0 } });
@@ -271,16 +216,12 @@ test.describe('Doc Header', () => {
await goToGridDoc(page); await goToGridDoc(page);
await expect( await expect(page.getByRole('button', { name: 'download' })).toBeVisible();
page.locator('h2').getByText('Mocked document'),
).toHaveAttribute('contenteditable');
await page.getByLabel('Open the document options').click(); await page.getByLabel('Open the document options').click();
await expect(page.getByRole('button', { name: 'Export' })).toBeVisible();
await expect( await expect(
page.getByRole('button', { name: 'Delete document' }), page.getByRole('button', { name: 'Delete document' }),
).toBeHidden(); ).toBeDisabled();
// Click somewhere else to close the options // Click somewhere else to close the options
await page.click('body', { position: { x: 0, y: 0 } }); await page.click('body', { position: { x: 0, y: 0 } });
@@ -349,16 +290,12 @@ test.describe('Doc Header', () => {
await goToGridDoc(page); await goToGridDoc(page);
await expect( await expect(page.getByRole('button', { name: 'download' })).toBeVisible();
page.locator('h2').getByText('Mocked document'),
).not.toHaveAttribute('contenteditable');
await page.getByLabel('Open the document options').click(); await page.getByLabel('Open the document options').click();
await expect(page.getByRole('button', { name: 'Export' })).toBeVisible();
await expect( await expect(
page.getByRole('button', { name: 'Delete document' }), page.getByRole('button', { name: 'Delete document' }),
).toBeHidden(); ).toBeDisabled();
// Click somewhere else to close the options // Click somewhere else to close the options
await page.click('body', { position: { x: 0, y: 0 } }); await page.click('body', { position: { x: 0, y: 0 } });
@@ -497,6 +434,7 @@ test.describe('Documents Header mobile', () => {
await goToGridDoc(page); await goToGridDoc(page);
await page.getByLabel('Open the document options').click();
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
await expect(page.getByLabel('Share modal')).toBeVisible(); await expect(page.getByLabel('Share modal')).toBeVisible();

View File

@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test';
import { waitForElementCount } from '../helpers'; import { waitForElementCount } from '../helpers';
import { addNewMember, createDoc, goToGridDoc } from './common'; import { addNewMember, createDoc, goToGridDoc, verifyDocName } from './common';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('/'); await page.goto('/');
@@ -127,7 +127,7 @@ test.describe('Document list members', () => {
test('it checks the role rules', async ({ page, browserName }) => { test('it checks the role rules', async ({ page, browserName }) => {
const [docTitle] = await createDoc(page, 'Doc role rules', browserName, 1); const [docTitle] = await createDoc(page, 'Doc role rules', browserName, 1);
await expect(page.locator('h2').getByText(docTitle)).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
@@ -188,7 +188,7 @@ test.describe('Document list members', () => {
test('it checks the delete members', async ({ page, browserName }) => { test('it checks the delete members', async ({ page, browserName }) => {
const [docTitle] = await createDoc(page, 'Doc role rules', browserName, 1); const [docTitle] = await createDoc(page, 'Doc role rules', browserName, 1);
await expect(page.locator('h2').getByText(docTitle)).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();

View File

@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { createDoc, goToGridDoc } from './common'; import { createDoc, goToGridDoc, verifyDocName } from './common';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('/'); await page.goto('/');
@@ -17,7 +17,7 @@ test.describe('Doc Table Content', () => {
1, 1,
); );
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible(); await verifyDocName(page, randomDoc);
await page.getByLabel('Open the document options').click(); await page.getByLabel('Open the document options').click();
await page await page
@@ -108,7 +108,7 @@ test.describe('Doc Table Content', () => {
1, 1,
); );
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible(); await verifyDocName(page, randomDoc);
await expect(page.getByLabel('Open the panel')).toBeHidden(); await expect(page.getByLabel('Open the panel')).toBeHidden();
const editor = page.locator('.ProseMirror'); const editor = page.locator('.ProseMirror');

View File

@@ -1,6 +1,11 @@
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { createDoc, goToGridDoc, mockedDocument } from './common'; import {
createDoc,
goToGridDoc,
mockedDocument,
verifyDocName,
} from './common';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.goto('/'); await page.goto('/');
@@ -10,7 +15,7 @@ test.describe('Doc Version', () => {
test('it displays the doc versions', async ({ page, browserName }) => { test('it displays the doc versions', async ({ page, browserName }) => {
const [randomDoc] = await createDoc(page, 'doc-version', browserName, 1); const [randomDoc] = await createDoc(page, 'doc-version', browserName, 1);
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible(); await verifyDocName(page, randomDoc);
await page.getByLabel('Open the document options').click(); await page.getByLabel('Open the document options').click();
await page await page
@@ -79,12 +84,12 @@ test.describe('Doc Version', () => {
await goToGridDoc(page); await goToGridDoc(page);
await expect(page.locator('h2').getByText('Mocked document')).toBeVisible(); await verifyDocName(page, 'Mocked document');
await page.getByLabel('Open the document options').click(); await page.getByLabel('Open the document options').click();
await expect( await expect(
page.getByRole('button', { name: 'Version history' }), page.getByRole('button', { name: 'Version history' }),
).toBeHidden(); ).toBeDisabled();
await page.getByRole('button', { name: 'Table of content' }).click(); await page.getByRole('button', { name: 'Table of content' }).click();
@@ -95,12 +100,12 @@ test.describe('Doc Version', () => {
test('it restores the doc version', async ({ page, browserName }) => { test('it restores the doc version', async ({ page, browserName }) => {
const [randomDoc] = await createDoc(page, 'doc-version', browserName, 1); const [randomDoc] = await createDoc(page, 'doc-version', browserName, 1);
await verifyDocName(page, randomDoc);
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible();
await page.locator('.bn-block-outer').last().click(); await page.locator('.bn-block-outer').last().click();
await page.locator('.bn-block-outer').last().fill('Hello'); await page.locator('.bn-block-outer').last().fill('Hello');
expect(true).toBe(true);
await goToGridDoc(page, { await goToGridDoc(page, {
title: randomDoc, title: randomDoc,
}); });
@@ -152,7 +157,7 @@ test.describe('Doc Version', () => {
}) => { }) => {
const [randomDoc] = await createDoc(page, 'doc-version', browserName, 1); const [randomDoc] = await createDoc(page, 'doc-version', browserName, 1);
await expect(page.locator('h2').getByText(randomDoc)).toBeVisible(); await verifyDocName(page, randomDoc);
const editor = page.locator('.ProseMirror'); const editor = page.locator('.ProseMirror');
await editor.locator('.bn-block-outer').last().click(); await editor.locator('.bn-block-outer').last().click();

View File

@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { createDoc, keyCloakSignIn } from './common'; import { createDoc, keyCloakSignIn, verifyDocName } from './common';
const browsersName = ['chromium', 'webkit', 'firefox']; const browsersName = ['chromium', 'webkit', 'firefox'];
@@ -85,7 +85,7 @@ test.describe('Doc Visibility: Restricted', () => {
1, 1,
); );
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
const urlDoc = page.url(); const urlDoc = page.url();
@@ -111,7 +111,7 @@ test.describe('Doc Visibility: Restricted', () => {
const [docTitle] = await createDoc(page, 'Restricted auth', browserName, 1); const [docTitle] = await createDoc(page, 'Restricted auth', browserName, 1);
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
const urlDoc = page.url(); const urlDoc = page.url();
@@ -139,7 +139,7 @@ test.describe('Doc Visibility: Restricted', () => {
const [docTitle] = await createDoc(page, 'Restricted auth', browserName, 1); const [docTitle] = await createDoc(page, 'Restricted auth', browserName, 1);
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
@@ -176,7 +176,7 @@ test.describe('Doc Visibility: Restricted', () => {
await page.goto(urlDoc); await page.goto(urlDoc);
await expect(page.locator('h2').getByText(docTitle)).toBeVisible(); await verifyDocName(page, docTitle);
await expect(page.getByRole('button', { name: 'Share' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Share' })).toBeVisible();
}); });
}); });
@@ -198,7 +198,7 @@ test.describe('Doc Visibility: Public', () => {
1, 1,
); );
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
await page await page
@@ -227,10 +227,14 @@ test.describe('Doc Visibility: Public', () => {
position: { x: 0, y: 0 }, position: { x: 0, y: 0 },
}); });
const cardContainer = page.getByLabel(
'It is the card information about the document.',
);
await expect(cardContainer.getByTestId('public-icon')).toBeVisible();
await expect( await expect(
page cardContainer.getByText('Public document', { exact: true }),
.getByLabel('It is the card information about the document.')
.getByText('Public', { exact: true }),
).toBeVisible(); ).toBeVisible();
const urlDoc = page.url(); const urlDoc = page.url();
@@ -261,7 +265,7 @@ test.describe('Doc Visibility: Public', () => {
const [docTitle] = await createDoc(page, 'Public editable', browserName, 1); const [docTitle] = await createDoc(page, 'Public editable', browserName, 1);
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
await page await page
@@ -290,10 +294,14 @@ test.describe('Doc Visibility: Public', () => {
position: { x: 0, y: 0 }, position: { x: 0, y: 0 },
}); });
const cardContainer = page.getByLabel(
'It is the card information about the document.',
);
await expect(cardContainer.getByTestId('public-icon')).toBeVisible();
await expect( await expect(
page cardContainer.getByText('Public document', { exact: true }),
.getByLabel('It is the card information about the document.')
.getByText('Public', { exact: true }),
).toBeVisible(); ).toBeVisible();
const urlDoc = page.url(); const urlDoc = page.url();
@@ -308,7 +316,7 @@ test.describe('Doc Visibility: Public', () => {
await page.goto(urlDoc); await page.goto(urlDoc);
await expect(page.locator('h2').getByText(docTitle)).toBeVisible(); await verifyDocName(page, docTitle);
await expect(page.getByRole('button', { name: 'Share' })).toBeHidden(); await expect(page.getByRole('button', { name: 'Share' })).toBeHidden();
await expect( await expect(
page.getByText('Read only, you cannot edit this document'), page.getByText('Read only, you cannot edit this document'),
@@ -333,7 +341,7 @@ test.describe('Doc Visibility: Authenticated', () => {
1, 1,
); );
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
await page await page
@@ -385,7 +393,7 @@ test.describe('Doc Visibility: Authenticated', () => {
1, 1,
); );
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
await page await page
@@ -451,7 +459,7 @@ test.describe('Doc Visibility: Authenticated', () => {
1, 1,
); );
await expect(page.getByRole('heading', { name: docTitle })).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
await page await page
@@ -498,7 +506,7 @@ test.describe('Doc Visibility: Authenticated', () => {
await page.goto(urlDoc); await page.goto(urlDoc);
await expect(page.locator('h2').getByText(docTitle)).toBeVisible(); await verifyDocName(page, docTitle);
await page.getByRole('button', { name: 'Share' }).click(); await page.getByRole('button', { name: 'Share' }).click();
await expect( await expect(
page.getByText('Read only, you cannot edit this document'), page.getByText('Read only, you cannot edit this document'),