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 a013c209f8c kie-issues#947: Playwright expansion phase - part 3 - DRDs
(#2462)
a013c209f8c is described below
commit a013c209f8c359bfc170abc5e6d907a5f6e49a0f
Author: Jozef Marko <[email protected]>
AuthorDate: Tue Aug 6 19:32:16 2024 +0200
kie-issues#947: Playwright expansion phase - part 3 - DRDs (#2462)
---
.../dmn-editor/src/diagram/DrdSelectorPanel.tsx | 10 +-
packages/dmn-editor/src/diagram/Palette.tsx | 12 +-
.../src/propertiesPanel/ShapeOptions.tsx | 10 +-
packages/dmn-editor/tests-e2e/__fixtures__/base.ts | 10 +
packages/dmn-editor/tests-e2e/__fixtures__/drds.ts | 56 +++
.../dmn-editor/tests-e2e/__fixtures__/drgNodes.ts | 42 +++
.../propertiesPanel/parts/shapeProperties.ts | 10 +-
.../drds/drds-decision-missing-dependency.png | Bin 0 -> 41144 bytes
.../drds/drds-decision-no-missing-dependency.png | Bin 0 -> 57096 bytes
.../drds/drds-decision-missing-dependency.png | Bin 0 -> 41199 bytes
.../drds/drds-decision-no-missing-dependency.png | Bin 0 -> 57144 bytes
.../drds/drds-decision-missing-dependency.png | Bin 0 -> 36645 bytes
.../drds/drds-decision-no-missing-dependency.png | Bin 0 -> 43095 bytes
.../drds/modelDecisionServicesInDrds.spec.ts | 242 +++++++++++++
.../dmn-editor/tests-e2e/drds/modelDrd.spec.ts | 376 +++++++++++++++++++++
15 files changed, 760 insertions(+), 8 deletions(-)
diff --git a/packages/dmn-editor/src/diagram/DrdSelectorPanel.tsx
b/packages/dmn-editor/src/diagram/DrdSelectorPanel.tsx
index 65f6b15cc7c..2f1f12611ee 100644
--- a/packages/dmn-editor/src/diagram/DrdSelectorPanel.tsx
+++ b/packages/dmn-editor/src/diagram/DrdSelectorPanel.tsx
@@ -72,7 +72,7 @@ export function DrdSelectorPanel() {
columnGap: "40px",
}}
>
- <div style={{ gridArea: "header-list" }}>
+ <div style={{ gridArea: "header-list" }}
data-testid={"kie-tools--dmn-editor--drd-selector-popover"}>
<div style={{ display: "flex", justifyContent: "space-between" }}>
<TextContent>
<Text component="h3">DRDs</Text>
@@ -115,7 +115,11 @@ export function DrdSelectorPanel() {
</EmptyState>
</>
)) || (
- <div style={{ gridArea: "content-list" }}
className={"kie-dmn-editor--drd-list"}>
+ <div
+ style={{ gridArea: "content-list" }}
+ className={"kie-dmn-editor--drd-list"}
+ data-testid={"kie-tools--dmn-editor--drd-list"}
+ >
{drds.map((drd, i) => (
<React.Fragment key={drd["@_id"]!}>
<button
@@ -140,7 +144,7 @@ export function DrdSelectorPanel() {
{drdName}
</Title>
{drds.length > 0 && (
- <Button variant={ButtonVariant.link} onClick={removeDrd}
style={{ padding: 0 }}>
+ <Button variant={ButtonVariant.link} onClick={removeDrd}
style={{ padding: 0 }} title="Remove DRD">
Remove
</Button>
)}
diff --git a/packages/dmn-editor/src/diagram/Palette.tsx
b/packages/dmn-editor/src/diagram/Palette.tsx
index 77a7f980b2a..665bb25f28d 100644
--- a/packages/dmn-editor/src/diagram/Palette.tsx
+++ b/packages/dmn-editor/src/diagram/Palette.tsx
@@ -102,7 +102,11 @@ export function Palette({ pulse }: { pulse: boolean }) {
return (
<>
<RF.Panel position={"top-left"}>
- <aside className={"kie-dmn-editor--drd-selector"} style={{ position:
"relative" }}>
+ <aside
+ data-testid={"kie-tools--dmn-editor--drd-selector"}
+ className={"kie-dmn-editor--drd-selector"}
+ style={{ position: "relative" }}
+ >
<div ref={drdSelectorPopoverRef} style={{ position: "absolute",
left: "56px", height: "100%", zIndex: -1 }} />
<InlineFeelNameInput
validate={() => true}
@@ -221,7 +225,11 @@ export function Palette({ pulse }: { pulse: boolean }) {
<br />
<aside className={"kie-dmn-editor--drg-panel-toggle"}>
{diagram.openLhsPanel === DiagramLhsPanel.DRG_NODES && (
- <div className={"kie-dmn-editor--palette-nodes-popover"} style={{
maxHeight }}>
+ <div
+ data-testid={"kie-tools--dmn-editor--palette-nodes-popover"}
+ className={"kie-dmn-editor--palette-nodes-popover"}
+ style={{ maxHeight }}
+ >
<DrgNodesPanel />
</div>
)}
diff --git a/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx
b/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx
index e144015f510..20ca486f27f 100644
--- a/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx
+++ b/packages/dmn-editor/src/propertiesPanel/ShapeOptions.tsx
@@ -502,7 +502,10 @@ export function ShapeOptions({
alignItems: "center",
}}
>
- <div style={{ gridArea: "position-x-value" }}>
+ <div
+ style={{ gridArea: "position-x-value" }}
+
data-testid={"kie-tools--dmn-editor--properties-panel-node-shape-x-input"}
+ >
<TextInput
aria-label={"X"}
type={"number"}
@@ -516,7 +519,10 @@ export function ShapeOptions({
<p>X</p>
</div>
- <div style={{ gridArea: "position-y-value" }}>
+ <div
+ style={{ gridArea: "position-y-value" }}
+
data-testid={"kie-tools--dmn-editor--properties-panel-node-shape-y-input"}
+ >
<TextInput
aria-label={"Y"}
type={"number"}
diff --git a/packages/dmn-editor/tests-e2e/__fixtures__/base.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/base.ts
index c8dd28a957f..1143c264a87 100644
--- a/packages/dmn-editor/tests-e2e/__fixtures__/base.ts
+++ b/packages/dmn-editor/tests-e2e/__fixtures__/base.ts
@@ -34,6 +34,8 @@ import { GroupPropertiesPanel } from
"./propertiesPanel/groupPropertiesPanel";
import { DiagramPropertiesPanel } from
"./propertiesPanel/diagramPropertiesPanel";
import { MultipleNodesPropertiesPanel } from
"./propertiesPanel/multipleNodesPropertiesPanel";
import { Overlays } from "./overlays";
+import { Drds } from "./drds";
+import { DrgNodes } from "./drgNodes";
import { DataTypes } from "./dataTypes";
import { BeePropertiesPanel } from "./propertiesPanel/beePropertiesPanel";
import { BoxedExpressionEditor } from
"@kie-tools/boxed-expression-component/tests-e2e/__fixtures__/boxedExpression";
@@ -44,6 +46,8 @@ type DmnEditorFixtures = {
bee: BoxedExpressionEditor;
dataTypes: DataTypes;
diagram: Diagram;
+ drds: Drds;
+ drgNodes: DrgNodes;
edges: Edges;
editor: Editor;
jsonModel: JsonModel;
@@ -70,6 +74,12 @@ export const test = base.extend<DmnEditorFixtures>({
dataTypes: async ({ page, monaco }, use) => {
await use(new DataTypes(page, monaco));
},
+ drds: async ({ page }, use) => {
+ await use(new Drds(page));
+ },
+ drgNodes: async ({ diagram, page }, use) => {
+ await use(new DrgNodes(diagram, page));
+ },
diagram: async ({ page }, use) => {
await use(new Diagram(page));
},
diff --git a/packages/dmn-editor/tests-e2e/__fixtures__/drds.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/drds.ts
new file mode 100644
index 00000000000..5c343e3779c
--- /dev/null
+++ b/packages/dmn-editor/tests-e2e/__fixtures__/drds.ts
@@ -0,0 +1,56 @@
+/*
+ * 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 { Page } from "@playwright/test";
+
+export class Drds {
+ constructor(public page: Page) {}
+
+ public async toggle() {
+ await
this.page.getByTestId("kie-tools--dmn-editor--drd-selector").getByTitle("Select
or edit DRD").click();
+ }
+
+ public async create(args: { name: string }) {
+ await
this.page.getByTestId("kie-tools--dmn-editor--drd-selector-popover").getByTitle("New
DRD").click();
+ await
this.page.getByTestId("kie-tools--dmn-editor--drd-selector").locator("input").fill(args.name);
+ await
this.page.getByTestId("kie-tools--dmn-editor--drd-selector").locator("input").press("Tab");
+ }
+
+ public async rename(args: { newName: string }) {
+ await
this.page.getByTestId("kie-tools--dmn-editor--drd-selector").locator("input").fill(args.newName);
+ await
this.page.getByTestId("kie-tools--dmn-editor--drd-selector").locator("input").press("Tab");
+ }
+
+ public async remove(args: { name: string }) {
+ await this.navigateTo({ name: args.name });
+ await this.page.getByTitle("Remove DRD").click();
+ }
+
+ public async navigateTo(args: { name: string }) {
+ await
this.page.getByTestId("kie-tools--dmn-editor--drd-list").getByText(args.name).click({
force: true });
+ }
+
+ public async getCurrent() {
+ return await
this.page.getByTestId("kie-tools--dmn-editor--drd-selector").locator("input").inputValue();
+ }
+
+ public async getAll() {
+ return await
this.page.getByTestId("kie-tools--dmn-editor--drd-list").locator("button").allInnerTexts();
+ }
+}
diff --git a/packages/dmn-editor/tests-e2e/__fixtures__/drgNodes.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/drgNodes.ts
new file mode 100644
index 00000000000..790b3778b1b
--- /dev/null
+++ b/packages/dmn-editor/tests-e2e/__fixtures__/drgNodes.ts
@@ -0,0 +1,42 @@
+/*
+ * 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 { Page } from "@playwright/test";
+import { Diagram } from "./diagram";
+
+export class DrgNodes {
+ constructor(
+ public diagram: Diagram,
+ public page: Page
+ ) {}
+
+ public async open() {
+ await this.page.getByTitle("DRG Nodes").click();
+ }
+
+ public popover() {
+ return
this.page.getByTestId("kie-tools--dmn-editor--palette-nodes-popover");
+ }
+
+ public async dragNode(args: { name: string; targetPosition: { x: number; y:
number } }) {
+ await this.popover()
+ .getByText(args.name, { exact: true })
+ .dragTo(this.diagram.get(), { targetPosition: args.targetPosition });
+ }
+}
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/shapeProperties.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/shapeProperties.ts
index 358def0d719..c06c0b22bae 100644
---
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/shapeProperties.ts
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/shapeProperties.ts
@@ -47,10 +47,18 @@ export class ShapeProperties {
const height = await this.panel
.getByTestId("kie-tools--dmn-editor--properties-panel-node-shape-height-input")
.inputValue();
+ const x = await this.panel
+
.getByTestId("kie-tools--dmn-editor--properties-panel-node-shape-x-input")
+ .locator("input")
+ .inputValue();
+ const y = await this.panel
+
.getByTestId("kie-tools--dmn-editor--properties-panel-node-shape-y-input")
+ .locator("input")
+ .inputValue();
await this.panel.getByTitle("Expand / collapse Shape").click();
- return { width: width, height: height };
+ return { width: width, height: height, x: x, y: y };
}
public async resetShape() {
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drds/drds-decision-missing-dependency.png
b/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drds/drds-decision-missing-dependency.png
new file mode 100644
index 00000000000..8c794431d47
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drds/drds-decision-missing-dependency.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drds/drds-decision-no-missing-dependency.png
b/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drds/drds-decision-no-missing-dependency.png
new file mode 100644
index 00000000000..8a26a86e0e0
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drds/drds-decision-no-missing-dependency.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drds/drds-decision-missing-dependency.png
b/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drds/drds-decision-missing-dependency.png
new file mode 100644
index 00000000000..bc92755b1ce
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drds/drds-decision-missing-dependency.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drds/drds-decision-no-missing-dependency.png
b/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drds/drds-decision-no-missing-dependency.png
new file mode 100644
index 00000000000..d7b1e96277f
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/chromium/drds/drds-decision-no-missing-dependency.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drds/drds-decision-missing-dependency.png
b/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drds/drds-decision-missing-dependency.png
new file mode 100644
index 00000000000..2c103fa4d23
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drds/drds-decision-missing-dependency.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drds/drds-decision-no-missing-dependency.png
b/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drds/drds-decision-no-missing-dependency.png
new file mode 100644
index 00000000000..ec9c182eb6e
Binary files /dev/null and
b/packages/dmn-editor/tests-e2e/__screenshots__/webkit/drds/drds-decision-no-missing-dependency.png
differ
diff --git
a/packages/dmn-editor/tests-e2e/drds/modelDecisionServicesInDrds.spec.ts
b/packages/dmn-editor/tests-e2e/drds/modelDecisionServicesInDrds.spec.ts
new file mode 100644
index 00000000000..adc4287a179
--- /dev/null
+++ b/packages/dmn-editor/tests-e2e/drds/modelDecisionServicesInDrds.spec.ts
@@ -0,0 +1,242 @@
+/*
+ * 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 } from "../__fixtures__/base";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Model Decision Services - DRD", () => {
+ //TODO Extract scenarios from
https://github.com/apache/incubator-kie-issues/issues/870
+
+ test("888 add to DRD, all DRDs depiction same", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/888");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/888",
+ });
+ // create non empty DS
+ // add the ^ DS into non default DRD
+ // all the DS content needs to be added into DRD also
+ });
+
+ test("888 add to DRD, automatically layout", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/888");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/888",
+ });
+ // add decision service, non empty, that is currently in no DRD
+ // its content should be automatically layout-ed
+ });
+
+ test("888 add to DRD, mix of collapsed and expanded", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/888");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/888",
+ });
+ // However, if one of its contained Decisions it also contained by other
Decision Services
+ // present on that DRD, and one of them is in expanded form,
+ // the Decision Service is added as collapsed, and no Decisions are added
or moved.
+ });
+
+ test("888 add to DRD, collapsed", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/888");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/888",
+ });
+ // prepare on empty DS
+ // add some of its content to different DRD
+ // collapse the DS
+ // add the DS into DRD where already some its content is
+ // the DS should be added as collapsed and its content removed from the DRD
+ });
+
+ test("894 do not allow add node that is already in DS and in DRD expanded",
async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/894");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/894",
+ });
+ // On the DMN Editor, do not allow adding a Decision to a DRD
+ // if this Decision is contained by one or more Decision Services already
present
+ // on that DRD, even if in collapsed state.
+ });
+
+ test("894 do not allow add node that is already in DS and in DRD collapsed",
async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/894");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/894",
+ });
+ // On the DMN Editor, do not allow adding a Decision to a DRD
+ // if this Decision is contained by one or more Decision Services already
present
+ // on that DRD, even if in collapsed state.
+ });
+
+ test("972 autolayout", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/972");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/972",
+ });
+ // TODO, question, not understand
+ });
+
+ test("892 collapse - remove its content", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/892");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/892",
+ });
+ // TODO
+ });
+
+ test("892 collapse - allow only if no other DS is expanded in the DRD",
async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/892");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/892",
+ });
+ // TODO
+ });
+
+ test("892 expand - same depiction as other DRDs", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/892");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/892",
+ });
+ // TODO
+ });
+
+ test("892 expand - allow only if no other DS is collpased in the DRD", async
({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/892");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/892",
+ });
+ // TODO
+ });
+
+ test("889 move DS content and replicate in DRDs", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/889");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/889",
+ });
+ // TODO
+ });
+
+ test("889 resize DS content and replicate in DRDs", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/889");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/889",
+ });
+ // TODO
+ });
+
+ test("898 move DS divider and replicate in DRDs", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/898");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/898",
+ });
+ // TODO
+ });
+
+ test("890 add node to DS, check its added to all DRDs where DS in expanded
form", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/890");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/890",
+ });
+ // TODO
+ });
+
+ test("890 add node to DS, check its removed from DRDs where DS in collapsed
form", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/890");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/890",
+ });
+ // TODO
+ });
+
+ test("891 remove node from DS, check its removed form DS in all DRDs", async
({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/891");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/891",
+ });
+ // TODO, question, isn't this the same as 889 - syncing depiction of DS in
all DRDs?
+ });
+
+ test("893 collapsed external DS, synced in all DRDs", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/893");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/893",
+ });
+ // TODO
+ });
+
+ test("893 expanded external DS, synced in all DRDs", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/893");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/893",
+ });
+ // TODO
+ });
+
+ test("893 remove node from DS, check its removed form DS in all DRDs", async
({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/893");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/893",
+ });
+ // TODO
+ });
+
+ test("895 ", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/895");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description: "https://github.com/apache/incubator-kie-issues/issues/895",
+ });
+ // TODO , Question, isn't that in conflict with other DRD tickets?
+ // is that even possible to be in state DS_One is collapsed
+ // DS_Two is expanded and both of them contain the same decision?
+ });
+
+ test("1298 ", async ({ drds }) => {
+ test.skip(true,
"https://github.com/apache/incubator-kie-issues/issues/1298");
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/1298",
+ });
+ // TODO
+ });
+});
diff --git a/packages/dmn-editor/tests-e2e/drds/modelDrd.spec.ts
b/packages/dmn-editor/tests-e2e/drds/modelDrd.spec.ts
new file mode 100644
index 00000000000..9ab8801f115
--- /dev/null
+++ b/packages/dmn-editor/tests-e2e/drds/modelDrd.spec.ts
@@ -0,0 +1,376 @@
+/*
+ * 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 { expect, test } from "../__fixtures__/base";
+import { DefaultNodeName, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Model DRD", () => {
+ test.describe("Model DRD - Create", () => {
+ test("should create DRD in empty model", async ({ drds, drgNodes }) => {
+ await drds.toggle();
+ await drds.create({ name: "second drd" });
+
+ await expect(drgNodes.popover()).toBeVisible();
+ await expect(drgNodes.popover()).toContainText("No DRG nodes yet");
+ expect(await drds.getCurrent()).toEqual("second drd");
+ });
+
+ test("should create DRD in non empty model", async ({ drds, drgNodes,
palette }) => {
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 100, y: 100 } });
+ await drds.toggle();
+ await drds.create({ name: "second drd" });
+
+ await expect(drgNodes.popover()).toBeVisible();
+ await expect(drgNodes.popover()).not.toContainText("No DRG nodes yet");
+ expect(await drds.getCurrent()).toEqual("second drd");
+ });
+ });
+
+ test.describe("Model DRD - Multiple DRDs", () => {
+ test.beforeEach("Create DRDs", async ({ drds }) => {
+ await drds.toggle();
+ await drds.create({ name: "First DRD" });
+
+ await drds.toggle();
+ await drds.create({ name: "Second DRD" });
+
+ await drds.toggle();
+ await drds.create({ name: "Third DRD" });
+ });
+
+ test.describe("Model DRD - Rename", () => {
+ test("should rename DRD and navigate away", async ({ drds }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.rename({ newName: "SECOND DRD" });
+ await drds.navigateTo({ name: "First DRD" });
+
+ expect(await drds.getAll()).toEqual(["1. First DRD", "2. SECOND DRD",
"3. Third DRD"]);
+ });
+
+ test("should rename DRD using non alphabet character", async ({ drds })
=> {
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.rename({ newName: "SECOND%20DRD" });
+
+ expect(await drds.getAll()).toEqual(["1. First DRD", "2.
SECOND%20DRD", "3. Third DRD"]);
+ });
+ });
+
+ test.describe("Model DRD - Delete", async () => {
+ test("should remove DRD and check the indexes", async ({ drds }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/1174",
+ });
+ await drds.toggle();
+ await drds.remove({ name: "Second DRD" });
+
+ expect(await drds.getAll()).toEqual(["1. First DRD", "2. Third DRD"]);
+ });
+ });
+
+ test.describe("Model DRD - Navigate", () => {
+ test("should navigate to the first DRD", async ({ drds }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+
+ expect(await drds.getCurrent()).toEqual("First DRD");
+ });
+
+ test("should navigate to multiple DRDs and stay in the last", async ({
drds }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.navigateTo({ name: "Second DRD" });
+
+ expect(await drds.getCurrent()).toEqual("Second DRD");
+ });
+ });
+
+ test.describe("Model DRD - Add Content", async () => {
+ test("should add DRG node to single DRD", async ({ drds, nodes, palette
}) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).not.toBeAttached();
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Third DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).not.toBeAttached();
+ });
+
+ test("should add DRG node to all DRDs", async ({ drds, drgNodes, nodes,
palette }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Third DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).toBeAttached();
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).toBeAttached();
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).toBeAttached();
+ });
+
+ test("should remove DRG node from all DRDs", async ({ drds, drgNodes,
nodes, palette }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Third DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+
+ await nodes.delete({ name: DefaultNodeName.DECISION });
+
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).not.toBeAttached();
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).not.toBeAttached();
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: DefaultNodeName.DECISION
})).not.toBeAttached();
+ });
+
+ test("should rename DRG node in all DRDs", async ({ drds, drgNodes,
nodes, palette }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Third DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+
+ await nodes.selectLabel({ name: DefaultNodeName.DECISION });
+ await nodes.rename({ current: DefaultNodeName.DECISION, new: "Renamed
Decision" });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: "Renamed Decision" })).toBeAttached();
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await expect(nodes.get({ name: "Renamed Decision" })).toBeAttached();
+ });
+
+ test("should add connection to all DRDs", async ({ drds, drgNodes,
diagram, edges, nodes, palette }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+ await diagram.resetFocus();
+ await palette.dragNewNode({ type: NodeType.INPUT_DATA, targetPosition:
{ x: 300, y: 500 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+ await drgNodes.dragNode({ name: DefaultNodeName.INPUT_DATA,
targetPosition: { x: 300, y: 500 } });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: DefaultNodeName.INPUT_DATA,
+ to: DefaultNodeName.DECISION,
+ });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await expect(
+ await edges.get({ from: DefaultNodeName.INPUT_DATA, to:
DefaultNodeName.DECISION })
+ ).toBeAttached();
+ });
+
+ test("should mark node with missing dependency indicator", async ({
+ drds,
+ drgNodes,
+ diagram,
+ nodes,
+ palette,
+ }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+ await diagram.resetFocus();
+ await palette.dragNewNode({ type: NodeType.INPUT_DATA, targetPosition:
{ x: 300, y: 500 } });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: DefaultNodeName.INPUT_DATA,
+ to: DefaultNodeName.DECISION,
+ });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+
+ await
expect(diagram.get()).toHaveScreenshot("drds-decision-missing-dependency.png");
+ });
+
+ test("should remove node missing dependency indicator", async ({
+ drds,
+ drgNodes,
+ diagram,
+ edges,
+ nodes,
+ palette,
+ }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+ await diagram.resetFocus();
+ await palette.dragNewNode({ type: NodeType.INPUT_DATA, targetPosition:
{ x: 300, y: 500 } });
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.INFORMATION_REQUIREMENT,
+ from: DefaultNodeName.INPUT_DATA,
+ to: DefaultNodeName.DECISION,
+ });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 300, y: 300 } });
+ await drgNodes.dragNode({ name: DefaultNodeName.INPUT_DATA,
targetPosition: { x: 300, y: 500 } });
+
+ await
expect(diagram.get()).toHaveScreenshot("drds-decision-no-missing-dependency.png");
+
+ await expect(
+ await edges.get({ from: DefaultNodeName.INPUT_DATA, to:
DefaultNodeName.DECISION })
+ ).toBeAttached();
+ });
+
+ test("should not move the original node depiction", async ({
+ decisionPropertiesPanel,
+ drds,
+ drgNodes,
+ nodes,
+ palette,
+ }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 500, y: 500 } });
+
+ await nodes.move({ name: DefaultNodeName.DECISION, targetPosition: {
x: 400, y: 400 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await nodes.select({ name: DefaultNodeName.DECISION });
+ await decisionPropertiesPanel.open();
+ const { x, y } = await decisionPropertiesPanel.getShape();
+ expect(x).toEqual("200");
+ expect(y).toEqual("200");
+ });
+
+ test("should not resize the original node depiction", async ({
+ decisionPropertiesPanel,
+ drds,
+ drgNodes,
+ nodes,
+ palette,
+ }) => {
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: {
x: 300, y: 300 } });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "Second DRD" });
+ await drds.toggle();
+ await drgNodes.open();
+ await drgNodes.dragNode({ name: DefaultNodeName.DECISION,
targetPosition: { x: 500, y: 500 } });
+
+ await nodes.resize({ nodeName: DefaultNodeName.DECISION, xOffset: 100,
yOffset: 100 });
+
+ await drds.toggle();
+ await drds.navigateTo({ name: "First DRD" });
+ await drds.toggle();
+ await nodes.select({ name: DefaultNodeName.DECISION });
+ await decisionPropertiesPanel.open();
+ const { width, height } = await decisionPropertiesPanel.getShape();
+ expect(width).toEqual("160");
+ expect(height).toEqual("80");
+ });
+ });
+ });
+});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]