test: fix e2e

This commit is contained in:
Zeke Zhang 2024-03-07 21:49:36 +08:00
parent 82d6bb8eb7
commit fc6d11be45
9 changed files with 17 additions and 17 deletions

View File

@ -53,7 +53,7 @@ test.describe('configure item actions', () => {
await mockRecord('general');
await nocoPage.goto();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActionsItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureItemActions-general').first().hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
@ -68,7 +68,7 @@ test.describe('configure item actions', () => {
await expect(page.getByLabel('action-Action.Link-Delete-destroy-general-grid-card').first()).toBeVisible();
// delete buttons
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActionsItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureItemActions-general').first().hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
@ -88,7 +88,7 @@ test.describe('configure item actions', () => {
await mockRecord('general');
await nocoPage.goto();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureActionsItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-gridCard:configureItemActions-general').first().hover();
await page.getByRole('menuitem', { name: 'Customize' }).hover();
await page.getByRole('menuitem', { name: 'Popup' }).click();
await page.getByRole('menuitem', { name: 'Update record' }).click();

View File

@ -51,7 +51,7 @@ test.describe('configure item actions', () => {
await mockRecord('general');
await nocoPage.goto();
await page.getByLabel('schema-initializer-ActionBar-list:configureActionsItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-list:configureItemActions-general').first().hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
@ -66,7 +66,7 @@ test.describe('configure item actions', () => {
await expect(page.getByLabel('action-Action.Link-Delete-destroy-general-list').first()).toBeVisible();
// delete buttons
await page.getByLabel('schema-initializer-ActionBar-list:configureActionsItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-list:configureItemActions-general').first().hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
@ -86,7 +86,7 @@ test.describe('configure item actions', () => {
await mockRecord('general');
await nocoPage.goto();
await page.getByLabel('schema-initializer-ActionBar-list:configureActionsItem-general').first().hover();
await page.getByLabel('schema-initializer-ActionBar-list:configureItemActions-general').first().hover();
await page.getByRole('menuitem', { name: 'Customize' }).hover();
await page.getByRole('menuitem', { name: 'Popup' }).click();
await page.getByRole('menuitem', { name: 'Update record' }).click();

View File

@ -567,7 +567,7 @@ test.describe('actions schema settings', () => {
test.describe('popup', () => {
const addSomeCustomActions = async (page: Page) => {
// 先删除掉之前的 actions
await page.getByRole('button', { name: 'Actions' }).hover();
await page.getByRole('button', { name: 'Actions', exact: true }).hover();
await page.getByLabel('designer-schema-settings-TableV2.Column-TableV2.ActionColumnDesigner-general').hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
@ -624,7 +624,7 @@ test.describe('actions schema settings', () => {
test.describe('update record', () => {
const addSomeCustomActions = async (page: Page) => {
// 先删除掉之前的 actions
await page.getByRole('button', { name: 'Actions' }).hover();
await page.getByRole('button', { name: 'Actions', exact: true }).hover();
await page.getByLabel('designer-schema-settings-TableV2.Column-TableV2.ActionColumnDesigner-general').hover();
await page.getByRole('menuitem', { name: 'View' }).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();

View File

@ -864,7 +864,7 @@ export async function expectInitializerMenu({ showMenu, supportedOptions, page }
* @param name
*/
export const createBlockInPage = async (page: Page, name: string) => {
await page.getByLabel('schema-initializer-Grid-BlockInitializers').hover();
await page.getByLabel('schema-initializer-Grid-page:addBlock').hover();
if (name === 'Form') {
await page.getByText('Form', { exact: true }).first().hover();

View File

@ -11,7 +11,7 @@ test.describe('TableActionColumnInitializers & DetailsActionInitializers & ReadP
const nocoPage = await mockPage(oneEmptyTableBlockWithCustomizeActions).waitForInit();
await mockRecords('general', 3);
await nocoPage.goto();
await page.getByRole('button', { name: 'Actions' }).hover();
await page.getByRole('button', { name: 'Actions', exact: true }).hover();
await page.getByLabel('designer-schema-settings-TableV2.Column-TableV2.ActionColumnDesigner-general').hover();
await page.getByRole('menuitem', { name: 'Duplicate' }).click();
await expect(page.getByLabel('action-Action.Link-Duplicate-duplicate-general-table-0')).toBeVisible();

View File

@ -17,7 +17,7 @@ test.describe('ReadPrettyFormActionInitializers & CalendarFormActionInitializers
await mockRecord('general', { singleLineText: 'test' });
await nocoPage.goto();
await page.getByTitle('test').click();
await page.getByLabel('schema-initializer-ActionBar-calendar:configureActionsForm-general').hover();
await page.getByLabel('schema-initializer-ActionBar-details:configureActions-general').hover();
await page.getByRole('menuitem', { name: 'Print' }).click();
await page.getByLabel('action-Action-Print-print-general-form').click();
});

View File

@ -5,7 +5,7 @@ test('edit button', async ({ page, mockPage, mockRecord }) => {
await mockRecord('t_unp4scqamw9');
// 新建一个 custom request action
await page.getByRole('button', { name: 'Actions' }).hover();
await page.getByRole('button', { name: 'Actions', exact: true }).hover();
await page.getByLabel('designer-schema-settings-TableV2.Column-TableV2.ActionColumnDesigner-').hover();
await page.getByRole('menuitem', { name: 'Customize right' }).hover();
await page.getByRole('menuitem', { name: 'Custom request' }).click();

View File

@ -16,7 +16,7 @@ test('drag and adjust start time, end time, and progress', async ({ page, mockPa
await page.getByRole('option', { name: 'Week' }).click();
await page.getByRole('menuitem', { name: 'Time scale' }).hover();
await page.mouse.move(300, 0);
await page.getByRole('button', { name: 'Actions' }).click();
await page.getByRole('button', { name: 'Actions', exact: true }).click();
await expect(page.locator('.calendarBottomText').first()).toHaveText(/W/);
await page.locator('.bar ').hover();
const draggableElement = await page.getByLabel('task-bar').getByRole('button').first();

View File

@ -43,7 +43,7 @@ test.describe('configure params in gantt block', () => {
await page.getByLabel('designer-schema-settings-CardItem-Gantt.Designer-general').hover();
await page.getByRole('menuitem', { name: 'Title field' }).click();
await page.getByRole('option', { name: 'Single line text2' }).locator('div').click();
await page.getByRole('button', { name: 'Actions' }).click();
await page.getByRole('button', { name: 'Actions', exact: true }).click();
await page.mouse.move(300, 0);
const barLabel = page.getByLabel('block-item-gantt').locator('.barLabel');
await barLabel.hover();
@ -57,7 +57,7 @@ test.describe('configure params in gantt block', () => {
await page.getByRole('menuitem', { name: 'Start date field' }).click();
await page.getByRole('option', { name: 'Start date time2' }).locator('div').click();
await page.mouse.move(300, 0);
await page.getByRole('button', { name: 'Actions' }).click();
await page.getByRole('button', { name: 'Actions', exact: true }).click();
await page.locator('.bar').hover({ position: { x: 20, y: 10 } });
await expect(page.getByLabel('nb-gantt-tooltip')).toHaveText(
new RegExp(String(getYmd(new Date(mockData['startDatetime2'])))),
@ -72,7 +72,7 @@ test.describe('configure params in gantt block', () => {
await page.getByRole('menuitem', { name: 'End date field' }).click();
await page.getByRole('option', { name: 'End date time2' }).locator('div').click();
await page.mouse.move(300, 0);
await page.getByRole('button', { name: 'Actions' }).click();
await page.getByRole('button', { name: 'Actions', exact: true }).click();
await page.locator('.bar').hover({ position: { x: 20, y: 10 } });
await expect(page.getByLabel('nb-gantt-tooltip')).toHaveText(
new RegExp(String(getYmd(new Date(mockData['endDatetime2'])))),
@ -88,7 +88,7 @@ test.describe('configure params in gantt block', () => {
await page.getByRole('option', { name: 'Week' }).click();
await page.getByRole('menuitem', { name: 'Time scale' }).hover();
await page.mouse.move(300, 0);
await page.getByRole('button', { name: 'Actions' }).click();
await page.getByRole('button', { name: 'Actions', exact: true }).click();
await page.locator('.bar').hover({ position: { x: 20, y: 10 } });
await expect(page.locator('.calendarBottomText').first()).toHaveText(/W/);
});