From 3c8c5813dea1a8e0f6619e6cf8db043386a4054d Mon Sep 17 00:00:00 2001 From: hongboji <116709317+hongboji@users.noreply.github.com> Date: Thu, 9 May 2024 13:42:14 +0800 Subject: [PATCH] test conditionNode e2e (#4295) * test conditionNode e2e * test: conditionNode e2e * test: conditionnode e2e --- .../conditionNode/BranchIntoYesAndNoFormulaEngine.test.ts | 8 ++++++++ .../conditionNode/BranchIntoYesAndNoMathEngine.test.ts | 4 ++++ .../conditionNode/continueWhenYesFormulaEngine.test.ts | 8 ++++++++ .../conditionNode/continueWhenYesMathEngine.test.ts | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoFormulaEngine.test.ts b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoFormulaEngine.test.ts index 4470ba4f54..605cf1913d 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoFormulaEngine.test.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoFormulaEngine.test.ts @@ -81,6 +81,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.lorem.words(); + await page.waitForTimeout(500); await page.keyboard.type(`=='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}=='${conditionalRightConstant}'`, @@ -197,6 +198,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.lorem.words(); + await page.waitForTimeout(500); await page.keyboard.type(`=='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}=='${conditionalRightConstant}'`, @@ -313,6 +315,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.lorem.words(); + await page.waitForTimeout(500); await page.keyboard.type(`!='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!='${conditionalRightConstant}'`, @@ -429,6 +432,7 @@ test('Collection event Add Data Trigger, determines that the trigger node single await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.lorem.words(); + await page.waitForTimeout(500); await page.keyboard.type(`!='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!='${conditionalRightConstant}'`, @@ -568,6 +572,7 @@ test('Collection event add data trigger, determine the trigger node integer vari await page.getByRole('menuitemcheckbox', { name: 'Trigger variables' }).click(); await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); + await page.waitForTimeout(500); await page.keyboard.type('==', { delay: 50 }); await page.getByLabel('variable-button').click(); await page.getByRole('menuitemcheckbox', { name: 'Node result' }).click(); @@ -718,6 +723,7 @@ test('Collection event add data trigger, determine trigger node integer variable await page.getByRole('menuitemcheckbox', { name: 'Trigger variables' }).click(); await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); + await page.waitForTimeout(500); await page.keyboard.type('==', { delay: 50 }); await page.getByLabel('variable-button').click(); await page.getByRole('menuitemcheckbox', { name: 'Node result' }).click(); @@ -858,6 +864,7 @@ test('Collection event add data trigger, determine trigger node integer variable await page.getByRole('menuitemcheckbox', { name: 'Trigger variables' }).click(); await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); + await page.waitForTimeout(500); await page.keyboard.type('!=', { delay: 50 }); await page.getByLabel('variable-button').click(); await page.getByRole('menuitemcheckbox', { name: 'Node result' }).click(); @@ -1002,6 +1009,7 @@ test('Collection event add data trigger, determine the trigger node integer vari await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.lorem.words(); + await page.waitForTimeout(500); await page.keyboard.type(`!='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!='${conditionalRightConstant}'`, diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoMathEngine.test.ts b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoMathEngine.test.ts index c9715dec73..2dbae4a4fc 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoMathEngine.test.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/BranchIntoYesAndNoMathEngine.test.ts @@ -82,6 +82,7 @@ test('Collection event add data trigger, determine trigger node integer field va await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`==${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}==${conditionalRightConstant}`, @@ -198,6 +199,7 @@ test('Collection event Add Data Trigger, determines that the trigger node intege await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`==${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}==${conditionalRightConstant}`, @@ -311,6 +313,7 @@ test('Collection event Add Data Trigger, determines that the trigger node intege await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`!=${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!=${conditionalRightConstant}`, @@ -424,6 +427,7 @@ test('Collection event add data trigger, determines that the trigger node intege await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`!=${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!=${conditionalRightConstant}`, diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesFormulaEngine.test.ts b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesFormulaEngine.test.ts index 6ced77382b..3bbd00cbe8 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesFormulaEngine.test.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesFormulaEngine.test.ts @@ -81,6 +81,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.string.alphanumeric(10); + await page.waitForTimeout(500); await page.keyboard.type(`=='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}=='${conditionalRightConstant}'`, @@ -163,6 +164,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.string.alphanumeric(10); + await page.waitForTimeout(500); await page.keyboard.type(`=='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}=='${conditionalRightConstant}'`, @@ -243,6 +245,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.string.alphanumeric(10); + await page.waitForTimeout(500); await page.keyboard.type(`!='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!='${conditionalRightConstant}'`, @@ -324,6 +327,7 @@ test('Collection event Add Data Trigger, Formula engine, determines that the tri await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.string.alphanumeric(10); + await page.waitForTimeout(500); await page.keyboard.type(`!='${conditionalRightConstant}'`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!='${conditionalRightConstant}'`, @@ -431,6 +435,7 @@ test('Collection event add data trigger, Formula engine, determine the trigger n await page.getByRole('menuitemcheckbox', { name: 'Trigger variables' }).click(); await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); + await page.waitForTimeout(500); await page.keyboard.type('==', { delay: 50 }); await page.getByLabel('variable-button').click(); await page.getByRole('menuitemcheckbox', { name: 'Node result' }).click(); @@ -541,6 +546,7 @@ test('Collection event add data trigger, Formula engine, determine trigger node await page.getByRole('menuitemcheckbox', { name: 'Trigger variables' }).click(); await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); + await page.waitForTimeout(500); await page.keyboard.type('==', { delay: 50 }); await page.getByLabel('variable-button').click(); await page.getByRole('menuitemcheckbox', { name: 'Node result' }).click(); @@ -649,6 +655,7 @@ test('Collection event add data trigger, Formula engine, determine trigger node await page.getByRole('menuitemcheckbox', { name: 'Trigger variables' }).click(); await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); + await page.waitForTimeout(500); await page.keyboard.type('!=', { delay: 50 }); await page.getByLabel('variable-button').click(); await page.getByRole('menuitemcheckbox', { name: 'Node result' }).click(); @@ -759,6 +766,7 @@ test('Collection event add data trigger, Formula engine, determine the trigger n await page.getByRole('menuitemcheckbox', { name: 'Trigger variables' }).click(); await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); + await page.waitForTimeout(500); await page.keyboard.type('!=', { delay: 50 }); await page.getByLabel('variable-button').click(); await page.getByRole('menuitemcheckbox', { name: 'Node result' }).click(); diff --git a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesMathEngine.test.ts b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesMathEngine.test.ts index 27590db715..07735e2d19 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesMathEngine.test.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/client/__e2e__/conditionNode/continueWhenYesMathEngine.test.ts @@ -82,6 +82,7 @@ test('Collection event add data trigger, Math engine, determine trigger node int await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`==${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}==${conditionalRightConstant}`, @@ -165,6 +166,7 @@ test('Collection event Add Data Trigger, Math engine, determines that the trigge await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`==${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}==${conditionalRightConstant}`, @@ -247,6 +249,7 @@ test('Collection event Add Data Trigger, Math engine, determines that the trigge await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`!=${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!=${conditionalRightConstant}`, @@ -329,6 +332,7 @@ test('Collection event add data trigger, Math engine, determines that the trigge await page.getByRole('menuitemcheckbox', { name: 'Trigger data' }).click(); await page.getByRole('menuitemcheckbox', { name: triggerNodeFieldDisplayName }).click(); const conditionalRightConstant = faker.number.int(); + await page.waitForTimeout(500); await page.keyboard.type(`!=${conditionalRightConstant}`, { delay: 50 }); await expect(conditionNode.conditionExpressionEditBox).toHaveText( `Trigger variables / Trigger data / ${triggerNodeFieldDisplayName}!=${conditionalRightConstant}`,