mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.5 KiB
88 lines
2.5 KiB
1 year ago
|
import { test } from '@playwright/test';
|
||
|
import { ProjectType, ProjectTypes } from 'nocodb-sdk';
|
||
|
import { DashboardPage } from '../../pages/Dashboard';
|
||
|
import setup, { NcContext } from '../../setup';
|
||
|
|
||
|
test.describe('Tiptap:Tab and multi line test', () => {
|
||
|
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('Tiptap:Tab and multi line test', async ({ page }) => {
|
||
|
const openedPage = await dashboard.docs.openedPage;
|
||
|
await dashboard.sidebar.docsSidebar.createPage({
|
||
|
projectTitle: project.title as any,
|
||
|
title: 'page',
|
||
|
});
|
||
|
|
||
|
await openedPage.tiptap.fillContent({ content: 'page content', index: 0 });
|
||
|
await openedPage.tiptap.fillContent({ content: 'page content 2', index: 1 });
|
||
|
await openedPage.tiptap.fillContent({ content: 'page content 3', index: 2 });
|
||
|
|
||
|
await openedPage.tiptap.clickNode({ index: 0, start: true });
|
||
|
|
||
|
await page.keyboard.press('Tab');
|
||
|
await page.waitForTimeout(100);
|
||
|
await page.keyboard.press('1');
|
||
|
|
||
|
await openedPage.tiptap.verifyNode({
|
||
|
index: 0,
|
||
|
content: 'page1 content',
|
||
|
});
|
||
|
|
||
|
await page.keyboard.press('Tab');
|
||
|
await page.waitForTimeout(100);
|
||
|
await page.keyboard.press('1');
|
||
|
|
||
|
await openedPage.tiptap.verifyNode({
|
||
|
index: 0,
|
||
|
content: 'page1 1content',
|
||
|
});
|
||
|
|
||
|
await page.keyboard.press('Tab');
|
||
|
await page.waitForTimeout(100);
|
||
|
await page.keyboard.press('1');
|
||
|
|
||
|
await openedPage.tiptap.verifyNode({
|
||
|
index: 0,
|
||
|
content: 'page1 1content1',
|
||
|
});
|
||
|
|
||
|
await page.keyboard.press('Tab');
|
||
|
await page.waitForTimeout(100);
|
||
|
await page.keyboard.press('1');
|
||
|
|
||
|
await openedPage.tiptap.verifyNode({
|
||
|
index: 1,
|
||
|
content: '1page content 2',
|
||
|
});
|
||
|
|
||
|
// Verify tab with multi line
|
||
|
await openedPage.tiptap.clickNode({ index: 1, start: false });
|
||
|
await page.keyboard.press('Shift+Enter');
|
||
|
await page.waitForTimeout(100);
|
||
|
await page.keyboard.press('2');
|
||
|
|
||
|
await openedPage.tiptap.verifyNode({
|
||
|
index: 1,
|
||
|
content: '1page content 22',
|
||
|
});
|
||
|
|
||
|
await openedPage.tiptap.clickNode({ index: 1, start: false });
|
||
|
await page.keyboard.press('Tab');
|
||
|
await page.waitForTimeout(100);
|
||
|
await page.keyboard.press('2');
|
||
|
|
||
|
await openedPage.tiptap.verifyNode({
|
||
|
index: 2,
|
||
|
content: '2page content 3',
|
||
|
});
|
||
|
});
|
||
|
});
|