import { test } from '@playwright/test'; import { ProjectType, ProjectTypes } from 'nocodb-sdk'; import { DashboardPage } from '../../pages/Dashboard'; import setup, { NcContext } from '../../setup'; test.describe('Docs page list', () => { let dashboard: DashboardPage; let context: NcContext; let project: ProjectType; test.beforeEach(async ({ page }) => { context = await setup({ page, projectType: ProjectTypes.DOCUMENTATION }); project = context.project; dashboard = new DashboardPage(page, context.project); }); test('Docs page list', async ({ page }) => { await dashboard.sidebar.docsSidebar.createPage({ projectTitle: project.title as any, title: 'page', }); await dashboard.sidebar.docsSidebar.createChildPage({ parentTitle: 'page', projectTitle: project.title as any, title: 'child-page', }); await dashboard.sidebar.docsSidebar.createPage({ projectTitle: project.title as any, title: 'page-2', }); await dashboard.shareProjectButton.open(); await dashboard.shareProjectButton.clickSharePage(); await dashboard.shareProjectButton.toggleSharePage(); await dashboard.shareProjectButton.close(); await dashboard.sidebar.openProject({ title: project.title as any, }); await page.waitForTimeout(1000); await dashboard.docs.pagesList.verifyPageInList({ title: 'page-2', tab: 'all', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'page', tab: 'all', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'child-page', tab: 'all', }); await dashboard.docs.pagesList.openTab({ tab: 'allByTitle', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'child-page', index: 0, tab: 'allByTitle', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'page', index: 1, tab: 'allByTitle', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'page-2', index: 2, tab: 'allByTitle', }); await dashboard.docs.pagesList.openTab({ tab: 'shared', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'page-2', tab: 'shared', }); await dashboard.sidebar.docsSidebar.openPage({ title: 'page', projectTitle: project.title as any, }); await dashboard.shareProjectButton.open(); await dashboard.shareProjectButton.toggleSharePage(); await dashboard.shareProjectButton.close(); await dashboard.sidebar.docsSidebar.openPage({ title: 'page-2', projectTitle: project.title as any, }); await dashboard.shareProjectButton.open(); await dashboard.shareProjectButton.toggleSharePage(); await dashboard.shareProjectButton.close(); await dashboard.sidebar.openProject({ title: project.title as any, }); await dashboard.docs.pagesList.openTab({ tab: 'shared', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'page', tab: 'shared', }); await dashboard.docs.pagesList.verifyPageInList({ title: 'child-page', tab: 'shared', }); }); });