mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 06:56:51 +00:00
- Rename `Project` => `Base` - Rename `Base` => `Source` - Remove `db` from data/meta api endpoints - Add backward compatibility for old apis - Migrations for renaming table and columns Signed-off-by: Pranav C <pranavxc@gmail.com>
139 lines
5.0 KiB
TypeScript
139 lines
5.0 KiB
TypeScript
import { test } from '@playwright/test';
|
|
import { BaseType, ProjectTypes } from 'nocodb-sdk';
|
|
import { DashboardPage } from '../../pages/Dashboard';
|
|
import setup, { NcContext } from '../../setup';
|
|
|
|
test.describe('Docs Tabs test', () => {
|
|
let dashboard: DashboardPage;
|
|
let context: NcContext;
|
|
let base: BaseType;
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
context = await setup({ page, baseType: ProjectTypes.DOCUMENTATION });
|
|
base = context.base;
|
|
dashboard = new DashboardPage(page, context.base);
|
|
});
|
|
|
|
test('Tab open and close for pages/book', async ({ page }) => {
|
|
await dashboard.verifyOpenedTab({ title: base.title as any });
|
|
|
|
await dashboard.sidebar.docsSidebar.createPage({
|
|
baseTitle: base.title as any,
|
|
title: 'nested-root-single-page',
|
|
});
|
|
await dashboard.docs.openedPage.verifyOpenedPageVisible();
|
|
|
|
await dashboard.verifyOpenedTab({ title: 'nested-root-single-page' });
|
|
|
|
await dashboard.sidebar.docsSidebar.createChildPage({
|
|
baseTitle: base.title as any,
|
|
parentTitle: 'nested-root-single-page',
|
|
title: 'nested-child-single-page',
|
|
});
|
|
await dashboard.docs.openedPage.verifyOpenedPageVisible();
|
|
await dashboard.verifyOpenedTab({ title: 'nested-child-single-page' });
|
|
|
|
await dashboard.docs.openedPage.fillTitle({ title: 'new-nested-child-single-page' });
|
|
await dashboard.verifyOpenedTab({ title: 'nested-child-single-page' });
|
|
|
|
await dashboard.sidebar.docsSidebar.selectEmoji({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
emoji: 'cool-button',
|
|
});
|
|
await dashboard.sidebar.docsSidebar.verifyEmoji({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
emoji: 'cool-button',
|
|
});
|
|
|
|
await dashboard.verifyOpenedTab({ title: 'nested-child-single-page', emoji: 'cool-button' });
|
|
|
|
await dashboard.sidebar.docsSidebar.selectEmoji({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
emoji: 'rolling-on-the-floor-laughing',
|
|
});
|
|
await dashboard.sidebar.docsSidebar.verifyEmoji({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
emoji: 'rolling-on-the-floor-laughing',
|
|
});
|
|
|
|
await dashboard.verifyOpenedTab({ title: 'nested-child-single-page', emoji: 'rolling-on-the-floor-laughing' });
|
|
await dashboard.docs.openedPage.verifyTitle({ title: 'new-nested-child-single-page' });
|
|
|
|
await dashboard.closeTab({ title: 'nested-child-single-page' });
|
|
await dashboard.verifyOpenedTab({ title: 'nested-root-single-page' });
|
|
await dashboard.docs.openedPage.verifyTitle({ title: 'nested-root-single-page' });
|
|
|
|
await dashboard.sidebar.docsSidebar.openPage({
|
|
baseTitle: base.title as any,
|
|
title: 'nested-root-single-page',
|
|
});
|
|
|
|
await dashboard.sidebar.docsSidebar.selectEmoji({
|
|
baseTitle: base.title as any,
|
|
title: 'nested-root-single-page',
|
|
emoji: 'rolling-on-the-floor-laughing',
|
|
});
|
|
await dashboard.sidebar.docsSidebar.verifyEmoji({
|
|
baseTitle: base.title as any,
|
|
title: 'nested-root-single-page',
|
|
emoji: 'rolling-on-the-floor-laughing',
|
|
});
|
|
|
|
await dashboard.verifyOpenedTab({ title: 'nested-root-single-page', emoji: 'rolling-on-the-floor-laughing' });
|
|
|
|
await dashboard.closeTab({ title: 'nested-root-single-page' });
|
|
await dashboard.verifyOpenedTab({ title: base.title as any });
|
|
await dashboard.docs.pagesList.verifyProjectTitle({ title: base.title as any });
|
|
|
|
// Delete verification
|
|
|
|
await dashboard.sidebar.docsSidebar.openPage({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
});
|
|
await dashboard.verifyOpenedTab({ title: 'new-nested-child-single-page' });
|
|
await dashboard.docs.openedPage.verifyTitle({ title: 'new-nested-child-single-page' });
|
|
|
|
await dashboard.sidebar.docsSidebar.deletePage({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
});
|
|
|
|
await dashboard.verifyOpenedTab({ title: base.title as any });
|
|
await dashboard.verifyTabIsNotOpened({ title: 'new-nested-child-single-page' });
|
|
|
|
await dashboard.sidebar.docsSidebar.verifyPageIsNotInSidebar({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
});
|
|
|
|
// Reload verification
|
|
await dashboard.sidebar.docsSidebar.openPage({
|
|
baseTitle: base.title as any,
|
|
title: 'nested-root-single-page',
|
|
});
|
|
|
|
// verify deleted page is not in sidebar
|
|
await dashboard.sidebar.docsSidebar.verifyPageIsNotInSidebar({
|
|
baseTitle: base.title as any,
|
|
title: 'new-nested-child-single-page',
|
|
});
|
|
|
|
await dashboard.verifyOpenedTab({ title: 'nested-root-single-page' });
|
|
await dashboard.docs.openedPage.verifyTitle({ title: 'nested-root-single-page' });
|
|
|
|
await page.reload();
|
|
|
|
await dashboard.verifyOpenedTab({ title: 'nested-root-single-page' });
|
|
|
|
await dashboard.sidebar.openProject({ title: base.title as any });
|
|
await page.reload();
|
|
|
|
await dashboard.verifyOpenedTab({ title: base.title });
|
|
});
|
|
});
|