From 78b7badeb65bfc603fb746efbdb8e242a763ae6a Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Thu, 7 Dec 2023 07:50:59 +0800 Subject: [PATCH] test: make testing more stable --- .../connectDataBlocks/tableBlock.test.ts | 12 ++++++++++-- .../formItem/creatingForm/relation.test.ts | 6 +++++- .../formItem/editingForm/relation.test.ts | 6 +++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/__tests__/e2e/schemaSettings/connectDataBlocks/tableBlock.test.ts b/packages/core/client/src/__tests__/e2e/schemaSettings/connectDataBlocks/tableBlock.test.ts index 1503ebcbd8..84397f7700 100644 --- a/packages/core/client/src/__tests__/e2e/schemaSettings/connectDataBlocks/tableBlock.test.ts +++ b/packages/core/client/src/__tests__/e2e/schemaSettings/connectDataBlocks/tableBlock.test.ts @@ -4,7 +4,11 @@ import { twoTableWithRelationalFields, twoTableWithSameCollection } from './temp test.describe('connect data blocks: table block', () => { test('connections between same collections', async ({ page, mockPage, mockRecords }) => { const nocoPage = await mockPage(twoTableWithSameCollection).waitForInit(); - const records = await mockRecords('users', 3); + const records = await mockRecords('users', [ + { email: 'aaaaa@gmail.com' }, + { email: 'bbbbb@gmail.com' }, + { email: 'ccccc@gmail.com' }, + ]); await nocoPage.goto(); // 将左边的 Table 连接到右边的 Table @@ -23,7 +27,11 @@ test.describe('connect data blocks: table block', () => { test('connecting via Relational Fields', async ({ page, mockPage, mockRecords }) => { const nocoPage = await mockPage(twoTableWithRelationalFields).waitForInit(); - const records = await mockRecords('users', 3); + await mockRecords('users', [ + { email: 'aaaaa@gmail.com' }, + { email: 'bbbbb@gmail.com' }, + { email: 'ccccc@gmail.com' }, + ]); await nocoPage.goto(); // 将左边的 Table 连接到右边的 Table diff --git a/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/creatingForm/relation.test.ts b/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/creatingForm/relation.test.ts index cce8c12ec7..00a3e91d47 100644 --- a/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/creatingForm/relation.test.ts +++ b/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/creatingForm/relation.test.ts @@ -3,7 +3,11 @@ import { commonTesting, testDefaultValue, testPattern } from '../commonTesting'; const gotoPage = async (mockPage, mockRecords) => { const nocoPage = await mockPage(oneTableBlockWithAddNewAndViewAndEditAndRelationFields).waitForInit(); - await mockRecords('users', 3); + await mockRecords('users', [ + { email: 'aaaaa@gmail.com' }, + { email: 'bbbbb@gmail.com' }, + { email: 'ccccc@gmail.com' }, + ]); await nocoPage.goto(); }; diff --git a/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/editingForm/relation.test.ts b/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/editingForm/relation.test.ts index 92ad38f0ac..9c4b134be4 100644 --- a/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/editingForm/relation.test.ts +++ b/packages/core/client/src/__tests__/e2e/schemaSettings/formItem/editingForm/relation.test.ts @@ -3,7 +3,11 @@ import { commonTesting, testPattern } from '../commonTesting'; const gotoPage = async (mockPage, mockRecords) => { const nocoPage = await mockPage(oneTableBlockWithAddNewAndViewAndEditAndRelationFields).waitForInit(); - await mockRecords('users', 3); + await mockRecords('users', [ + { email: 'aaaaa@gmail.com' }, + { email: 'bbbbb@gmail.com' }, + { email: 'ccccc@gmail.com' }, + ]); const record = (await mockRecords('general', 1))[0]; await nocoPage.goto();