From a00f4ac69ba9fa2ca7f1dd5ef7dbf8ab320cfd6c Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Sat, 13 Apr 2024 12:53:25 +0800 Subject: [PATCH] test: fix e2e to make pass --- .../details-multi/__e2e__/schemaInitializer.test.ts | 3 ++- .../src/client/__e2e__/schemaSettings.test.ts | 5 +++-- .../src/client/__e2e__/editLocalStorage.test.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaInitializer.test.ts b/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaInitializer.test.ts index 487fd284ae..46701af977 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaInitializer.test.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/details-multi/__e2e__/schemaInitializer.test.ts @@ -92,8 +92,9 @@ test.describe('configure fields', () => { test.describe('configure actions', () => { test('edit & delete & duplicate', async ({ page, mockPage, mockRecord }) => { - await mockPage(oneEmptyDetailsBlock).goto(); + const nocoPage = await mockPage(oneEmptyDetailsBlock).waitForInit(); await mockRecord('general'); + await nocoPage.goto(); await page.getByLabel('schema-initializer-ActionBar-detailsWithPaging:configureActions-general').hover(); await page.getByRole('menuitem', { name: 'Edit' }).click(); diff --git a/packages/plugins/@nocobase/plugin-custom-request/src/client/__e2e__/schemaSettings.test.ts b/packages/plugins/@nocobase/plugin-custom-request/src/client/__e2e__/schemaSettings.test.ts index 1325eeb1ed..0768cea571 100644 --- a/packages/plugins/@nocobase/plugin-custom-request/src/client/__e2e__/schemaSettings.test.ts +++ b/packages/plugins/@nocobase/plugin-custom-request/src/client/__e2e__/schemaSettings.test.ts @@ -1,9 +1,10 @@ -import { test, expect, oneEmptyTable, oneEmptyForm } from '@nocobase/test/e2e'; +import { expect, oneEmptyForm, oneEmptyTable, test } from '@nocobase/test/e2e'; test.describe('custom request action', () => { test('edit button', async ({ page, mockPage, mockRecord }) => { - await mockPage(oneEmptyTable).goto(); + const nocoPage = await mockPage(oneEmptyTable).waitForInit(); await mockRecord('t_unp4scqamw9'); + await nocoPage.goto(); // 新建一个 custom request action await page.getByRole('button', { name: 'Actions', exact: true }).hover(); diff --git a/packages/plugins/@nocobase/plugin-file-manager/src/client/__e2e__/editLocalStorage.test.ts b/packages/plugins/@nocobase/plugin-file-manager/src/client/__e2e__/editLocalStorage.test.ts index 488d68638c..ebcfe6b6dc 100644 --- a/packages/plugins/@nocobase/plugin-file-manager/src/client/__e2e__/editLocalStorage.test.ts +++ b/packages/plugins/@nocobase/plugin-file-manager/src/client/__e2e__/editLocalStorage.test.ts @@ -28,7 +28,7 @@ test.describe('File manager', () => { await expect(page.getByText(storageName)).toBeVisible(); // 2、测试步骤:点击“文件管理器”-“编辑”按钮,编辑标题,点击“确定”按钮 - await page.getByText('Edit').nth(2).click(); + await page.getByText('Edit', { exact: true }).nth(1).click(); const editLocalStorage = new EditLocalStorage(page); caseTitle = caseTitle + dayjs().format('YYYYMMDDHHmmssSSS').toString(); await editLocalStorage.title.fill(caseTitle);