This is an automated email from the ASF dual-hosted git repository.
tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new a99f44cd9b4 kie-issues#947: Playwright expansion phase - part 2 -
Decision Service node (#2454)
a99f44cd9b4 is described below
commit a99f44cd9b4f1be6583a252bb8dbc0ab765d817a
Author: Jozef Marko <[email protected]>
AuthorDate: Fri Aug 9 16:49:18 2024 +0200
kie-issues#947: Playwright expansion phase - part 2 - Decision Service node
(#2454)
---
packages/dmn-editor/src/draggable/Draggable.tsx | 27 +-
.../propertiesPanel/DecisionServiceProperties.tsx | 13 +-
.../decisionServicePropertiesPanel.ts | 72 ++++
.../resize-non-empty-decision-service.png | Bin 0 -> 48791 bytes
.../resize-non-empty-decision-service.png | Bin 0 -> 48841 bytes
.../resize-non-empty-decision-service.png | Bin 0 -> 43423 bytes
.../drgElements/modelDecisionService.spec.ts | 365 +++++++++++++++++++++
.../drgElements/resizeDecisionService.spec.ts | 22 ++
8 files changed, 482 insertions(+), 17 deletions(-)
diff --git a/packages/dmn-editor/src/draggable/Draggable.tsx
b/packages/dmn-editor/src/draggable/Draggable.tsx
index 59040cb0215..25fa300f9e9 100644
--- a/packages/dmn-editor/src/draggable/Draggable.tsx
+++ b/packages/dmn-editor/src/draggable/Draggable.tsx
@@ -253,24 +253,27 @@ export function Draggable(props: {
data-testid={`kie-tools--dmn-editor--draggable-row-${props.index}`}
>
{!props.isDisabled ? (
- <Icon
- className={"kie-dmn-editor--draggable-icon"}
- onPointerEnter={() => setDraggable(true)}
- onPointerLeave={() => setDraggable(false)}
- style={props.handlerStyle}
- >
- <GripVerticalIcon
- className={
- hovered ? "kie-dmn-editor--draggable-icon-handler-hovered" :
"kie-dmn-editor--draggable-icon-handler"
- }
- />
- </Icon>
+ <div data-testid={"kie-tools--dmn-editor--draggable-icon"}>
+ <Icon
+ className={"kie-dmn-editor--draggable-icon"}
+ onPointerEnter={() => setDraggable(true)}
+ onPointerLeave={() => setDraggable(false)}
+ style={props.handlerStyle}
+ >
+ <GripVerticalIcon
+ className={
+ hovered ? "kie-dmn-editor--draggable-icon-handler-hovered" :
"kie-dmn-editor--draggable-icon-handler"
+ }
+ />
+ </Icon>
+ </div>
) : (
<div style={{ width: "36px" }}></div>
)}
<div
style={props.childrenStyle}
className={`kie-dmn-editor--draggable-children
${props.childrenClassName ? props.childrenClassName : ""}`}
+ data-testid={"kie-tools--dmn-editor--draggable-children"}
>
<DraggableItemContext.Provider value={{ hovered
}}>{props.children}</DraggableItemContext.Provider>
</div>
diff --git
a/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx
b/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx
index 76adad60526..b2c7a7ff810 100644
--- a/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx
+++ b/packages/dmn-editor/src/propertiesPanel/DecisionServiceProperties.tsx
@@ -161,14 +161,17 @@ export function DecisionServiceProperties({
</ClipboardCopy>
</FormGroup>
- <FormGroup label="Output decisions">
+ <FormGroup label="Output decisions"
data-testid={"kie-tools--dmn-editor--decision-service-output-decisions"}>
<DecisionServiceElementList
decisionServiceNamespace={namespace}
elements={decisionService.outputDecision}
allDrgElementsByHref={allDrgElementsByHref}
/>
</FormGroup>
- <FormGroup label="Encapsulated decisions">
+ <FormGroup
+ label="Encapsulated decisions"
+
data-testid={"kie-tools--dmn-editor--decision-service-encapsulated-decisions"}
+ >
<DecisionServiceElementList
decisionServiceNamespace={namespace}
elements={decisionService.encapsulatedDecision}
@@ -177,7 +180,7 @@ export function DecisionServiceProperties({
</FormGroup>
<Divider />
- <FormGroup label="Input decisions">
+ <FormGroup label="Input decisions"
data-testid={"kie-tools--dmn-editor--decision-service-input-decisions"}>
<DraggableDecisionServiceElementList
decisionServiceNamespace={namespace}
elements={decisionService.inputDecision}
@@ -191,7 +194,7 @@ export function DecisionServiceProperties({
isDisabled={isReadonly}
/>
</FormGroup>
- <FormGroup label="Input data">
+ <FormGroup label="Input data"
data-testid={"kie-tools--dmn-editor--decision-service-input-data"}>
<DraggableDecisionServiceElementList
decisionServiceNamespace={namespace}
elements={decisionService.inputData}
@@ -435,7 +438,7 @@ function DecisionServiceEquivalentFunction({
return (
<Alert variant={AlertVariant.info} isInline title="Invoking this Decision
Service in FEEL">
- <p style={{ fontFamily: "monospace" }}>
+ <p data-testid={"kie-tools--dmn-editor--decision-service-feel"} style={{
fontFamily: "monospace" }}>
{`${decisionService["@_name"]}(${buildFunctionArgList(
decisionService.inputDecision,
decisionService.inputData
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionServicePropertiesPanel.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionServicePropertiesPanel.ts
index 084ce1fb23f..1c6467efc6d 100644
---
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionServicePropertiesPanel.ts
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionServicePropertiesPanel.ts
@@ -120,4 +120,76 @@ export class DecisionServicePropertiesPanel extends
PropertiesPanelBase {
public async setStrokeColor(args: { color: string }) {
await this.shapeProperties.setStrokeColor({ ...args });
}
+
+ public async getOutputDecisions() {
+ return (
+ await this.panel()
+
.getByTestId("kie-tools--dmn-editor--decision-service-output-decisions")
+ .getByRole("listitem")
+ .allTextContents()
+ ).map((content) => content.trim());
+ }
+
+ public async getEncapsulatedDecisions() {
+ return (
+ await this.panel()
+
.getByTestId("kie-tools--dmn-editor--decision-service-encapsulated-decisions")
+ .getByRole("listitem")
+ .allTextContents()
+ ).map((content) => content.trim());
+ }
+
+ public async getInputDecisions() {
+ return (
+ await this.panel()
+ .getByTestId("kie-tools--dmn-editor--decision-service-input-decisions")
+ .getByTestId("kie-tools--dmn-editor--draggable-children")
+ .allTextContents()
+ ).map((content) => content.trim());
+ }
+
+ public async moveInputDecision(args: { fromIndex: number; toIndex: number })
{
+ const target = this.panel()
+ .getByTestId("kie-tools--dmn-editor--decision-service-input-decisions")
+ .getByTestId("kie-tools--dmn-editor--draggable-icon")
+ .nth(args.toIndex);
+
+ const source = this.panel()
+ .getByTestId("kie-tools--dmn-editor--decision-service-input-decisions")
+ .getByTestId("kie-tools--dmn-editor--draggable-icon")
+ .nth(args.fromIndex);
+
+ await source.hover();
+ await source.dispatchEvent("dragstart");
+ await source.dragTo(target);
+ }
+
+ public async getInputData() {
+ return (
+ await this.panel()
+ .getByTestId("kie-tools--dmn-editor--decision-service-input-data")
+ .getByTestId("kie-tools--dmn-editor--draggable-children")
+ .allTextContents()
+ ).map((content) => content.trim());
+ }
+
+ public async moveInputData(args: { fromIndex: number; toIndex: number }) {
+ const target = this.panel()
+ .getByTestId("kie-tools--dmn-editor--decision-service-input-data")
+ .getByTestId("kie-tools--dmn-editor--draggable-icon")
+ .nth(args.toIndex);
+
+ const source = this.panel()
+ .getByTestId("kie-tools--dmn-editor--decision-service-input-data")
+ .getByTestId("kie-tools--dmn-editor--draggable-icon")
+ .nth(args.fromIndex);
+
+ await source.hover();
+ await source.dispatchEvent("dragstart");
+ await source.dragTo(target);
+ }
+
+ public async getInvokingThisDecisionServiceInFeel() {
+ return await
this.panel().getByTestId("kie-tools--dmn-editor--decision-service-feel").textContent();
+ }
}
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drgElements/resize-non-empty-decision-service.png
b/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drgElements/resize-non-empty-decision-service.png
new file mode 100644
index 00000000000..387a00867a8
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drgElements/resize-non-empty-decision-service.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drgElements/resize-non-empty-decision-service.png
b/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drgElements/resize-non-empty-decision-service.png
new file mode 100644
index 00000000000..f5734fb28f4
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drgElements/resize-non-empty-decision-service.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drgElements/resize-non-empty-decision-service.png
b/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drgElements/resize-non-empty-decision-service.png
new file mode 100644
index 00000000000..db6fa34f1f4
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drgElements/resize-non-empty-decision-service.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/drgElements/modelDecisionService.spec.ts
b/packages/dmn-editor/tests-e2e/drgElements/modelDecisionService.spec.ts
new file mode 100644
index 00000000000..e5eeb707fb2
--- /dev/null
+++ b/packages/dmn-editor/tests-e2e/drgElements/modelDecisionService.spec.ts
@@ -0,0 +1,365 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { TestAnnotations } from "@kie-tools/playwright-base/annotations";
+import { test, expect } from "../__fixtures__/base";
+import { EdgeType } from "../__fixtures__/edges";
+import { DefaultNodeName, NodePosition, NodeType } from
"../__fixtures__/nodes";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Model Decision Service", () => {
+ test.describe("Model Decision Service - Signature", () => {
+ test.beforeEach(async ({ diagram, palette }) => {
+ await palette.dragNewNode({ type: NodeType.DECISION_SERVICE,
targetPosition: { x: 300, y: 100 } });
+ await diagram.resetFocus();
+ });
+
+ test("Decision Service Output Decisions Signature should be not empty",
async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/663",
+ });
+
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 } });
+ await diagram.resetFocus();
+ await nodes.move({ name: DefaultNodeName.DECISION, targetPosition: { x:
400, y: 180 } });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getInvokingThisDecisionServiceInFeel()).toEqual(
+ "New Decision Service()"
+ );
+ expect(await
decisionServicePropertiesPanel.getOutputDecisions()).toEqual(["New Decision"]);
+ });
+
+ test("Decision Service Encapsulated Decisions Signature should be not
empty", async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/663",
+ });
+
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 } });
+ await diagram.resetFocus();
+ await nodes.move({ name: DefaultNodeName.DECISION, targetPosition: { x:
400, y: 350 } });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getInvokingThisDecisionServiceInFeel()).toEqual(
+ "New Decision Service()"
+ );
+ expect(await
decisionServicePropertiesPanel.getEncapsulatedDecisions()).toEqual(["New
Decision"]);
+ });
+
+ test("Decision Service Input Data Signature should be not empty", async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/663",
+ });
+
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 } });
+ await diagram.resetFocus();
+ await nodes.move({ name: DefaultNodeName.DECISION, targetPosition: { x:
400, y: 350 } });
+
+ await palette.dragNewNode({ type: NodeType.INPUT_DATA, targetPosition: {
x: 100, y: 100 } });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: DefaultNodeName.INPUT_DATA,
+ to: DefaultNodeName.DECISION,
+ });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getInvokingThisDecisionServiceInFeel()).toEqual(
+ "New Decision Service(New Input Data)"
+ );
+ expect(await
decisionServicePropertiesPanel.getInputData()).toEqual(["New Input Data"]);
+ });
+
+ test("Decision Service Input Decisions Signature should be not empty",
async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/663",
+ });
+
+ await palette.dragNewNode({
+ type: NodeType.DECISION,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Decision One",
+ });
+ await diagram.resetFocus();
+ await nodes.move({ name: "Decision One", targetPosition: { x: 400, y:
350 } });
+
+ await palette.dragNewNode({
+ type: NodeType.DECISION,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Decision Two",
+ });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: "Decision Two",
+ to: "Decision One",
+ });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getInvokingThisDecisionServiceInFeel()).toEqual(
+ "New Decision Service(Decision Two)"
+ );
+ expect(await
decisionServicePropertiesPanel.getInputDecisions()).toEqual(["Decision Two"]);
+ });
+
+ test.describe("Model Decision Service - Signature - Inputs Order", () => {
+ test.beforeEach("Initialize nodes and connections", async ({ diagram,
nodes, palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.DECISION,
+ targetPosition: { x: 100, y: 100 },
+ });
+ await diagram.resetFocus();
+ await nodes.move({ name: DefaultNodeName.DECISION, targetPosition: {
x: 400, y: 350 } });
+
+ await palette.dragNewNode({
+ type: NodeType.DECISION,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "B",
+ });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: "B",
+ to: DefaultNodeName.DECISION,
+ });
+
+ await palette.dragNewNode({
+ type: NodeType.DECISION,
+ targetPosition: { x: 100, y: 200 },
+ thenRenameTo: "A",
+ });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: "A",
+ to: DefaultNodeName.DECISION,
+ });
+
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 100, y: 300 },
+ thenRenameTo: "BB",
+ });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: "BB",
+ to: DefaultNodeName.DECISION,
+ });
+
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 100, y: 400 },
+ thenRenameTo: "AA",
+ });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: "AA",
+ to: DefaultNodeName.DECISION,
+ });
+ });
+
+ test("Decision Service Inputs Signature should have a default order",
async ({
+ decisionServicePropertiesPanel,
+ nodes,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/664",
+ });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getInvokingThisDecisionServiceInFeel()).toEqual(
+ "New Decision Service(B, A, BB, AA)"
+ );
+ expect(await
decisionServicePropertiesPanel.getInputDecisions()).toEqual(["B", "A"]);
+ expect(await
decisionServicePropertiesPanel.getInputData()).toEqual(["BB", "AA"]);
+ });
+
+ test("Decision Service Inputs Signature should be reordered", async ({
+ decisionServicePropertiesPanel,
+ nodes,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/664",
+ });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ await decisionServicePropertiesPanel.moveInputData({ fromIndex: 0,
toIndex: 1 });
+ await decisionServicePropertiesPanel.moveInputDecision({ fromIndex: 0,
toIndex: 1 });
+ expect(await
decisionServicePropertiesPanel.getInvokingThisDecisionServiceInFeel()).toEqual(
+ "New Decision Service(A, B, AA, BB)"
+ );
+ expect(await
decisionServicePropertiesPanel.getInputDecisions()).toEqual(["A", "B"]);
+ expect(await
decisionServicePropertiesPanel.getInputData()).toEqual(["AA", "BB"]);
+ });
+ });
+
+ test.describe("Model Decision Service - Signature - Decisions", () => {
+ test.beforeEach(async ({ decisionServicePropertiesPanel, diagram, nodes,
palette }) => {
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 }, thenRenameTo: "A" });
+ await diagram.resetFocus();
+ await nodes.move({ name: "A", targetPosition: { x: 400, y: 180 } });
+
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 }, thenRenameTo: "B" });
+ await diagram.resetFocus();
+ await nodes.move({ name: "B", targetPosition: { x: 400, y: 350 } });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getOutputDecisions()).toEqual(["A"]);
+ expect(await
decisionServicePropertiesPanel.getEncapsulatedDecisions()).toEqual(["B"]);
+ });
+
+ test("Decision Service Decision Signature should not contain deleted
Output Decision", async ({
+ decisionServicePropertiesPanel,
+ nodes,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/879",
+ });
+ await nodes.delete({ name: "A" });
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ expect(await
decisionServicePropertiesPanel.getOutputDecisions()).toEqual(["(Empty)"]);
+ });
+
+ test("Decision Service Decision Signature should not contain deleted
Encapsulated Decision", async ({
+ decisionServicePropertiesPanel,
+ nodes,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/879",
+ });
+ await nodes.delete({ name: "B" });
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ expect(await
decisionServicePropertiesPanel.getEncapsulatedDecisions()).toEqual(["(Empty)"]);
+ });
+ });
+
+ test.describe("Model Decision Service - Add Content", () => {
+ test("Decision Service should allow to drag Decision into it from
palette", async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/896");
+ test.info().annotations.push({
+ type: TestAnnotations.AFFECTED_BY,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/896",
+ });
+
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 400, y: 300 } });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getEncapsulatedDecisions()).toEqual([DefaultNodeName.DECISION]);
+ });
+
+ test("Decision Service should allow to add connected Decision from a
contained Decision", async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/897");
+ test.info().annotations.push({
+ type: TestAnnotations.AFFECTED_BY,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/897",
+ });
+
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 }, thenRenameTo: "A" });
+ await diagram.resetFocus();
+ await nodes.move({ name: "A", targetPosition: { x: 400, y: 180 } });
+
+ await nodes.resize({
+ nodeName: DefaultNodeName.DECISION_SERVICE,
+ position: NodePosition.TOP,
+ xOffset: 350,
+ yOffset: 0,
+ });
+
+ await nodes.dragNewConnectedNode({ type: NodeType.DECISION, from: "A",
targetPosition: { x: 500, y: 160 } });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+
+ expect(await
decisionServicePropertiesPanel.getOutputDecisions()).toEqual(["A, New
Decision"]);
+ });
+
+ test("Decision Service should allow to move contained Decision by a
keyboard without crossing sections", async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ page,
+ palette,
+ }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/876");
+ test.info().annotations.push({
+ type: TestAnnotations.AFFECTED_BY,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/876",
+ });
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 } });
+ await diagram.resetFocus();
+ await nodes.move({ name: DefaultNodeName.DECISION, targetPosition: {
x: 400, y: 180 } });
+
+ for (let index = 0; index < 10; index++) {
+ await page.keyboard.press("ArrowDown");
+ }
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ expect(await
decisionServicePropertiesPanel.getOutputDecisions()).toEqual(["New Decision"]);
+
+ await
expect(diagram.get()).toHaveScreenshot("move-decision-in-decision-service-by-keyboard.png");
+ });
+ });
+ });
+});
diff --git
a/packages/dmn-editor/tests-e2e/drgElements/resizeDecisionService.spec.ts
b/packages/dmn-editor/tests-e2e/drgElements/resizeDecisionService.spec.ts
index c1e3dd2e4bf..eca69bae427 100644
--- a/packages/dmn-editor/tests-e2e/drgElements/resizeDecisionService.spec.ts
+++ b/packages/dmn-editor/tests-e2e/drgElements/resizeDecisionService.spec.ts
@@ -304,5 +304,27 @@ test.describe("Resize node - Decision Service", () => {
expect(height).toEqual("280");
expect(width).toEqual("280");
});
+
+ test("should resize non empty Decision Service", async ({
+ decisionServicePropertiesPanel,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/881",
+ });
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 400, y: 100 } });
+ await diagram.resetFocus();
+ // move into Decision Service
+ await nodes.move({ name: DefaultNodeName.DECISION, targetPosition: { x:
200, y: 200 } });
+
+ await nodes.select({ name: DefaultNodeName.DECISION_SERVICE, position:
NodePosition.TOP });
+ await decisionServicePropertiesPanel.open();
+ await decisionServicePropertiesPanel.setShape({ width: "250", height:
"500" });
+
+ await
expect(diagram.get()).toHaveScreenshot("resize-non-empty-decision-service.png");
+ });
});
});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]