You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "ljmotta (via GitHub)" <gi...@apache.org> on 2024/03/26 13:12:10 UTC
[PR] kie-issues#946: Action plan - Exploratory phase of the strategy for implementing the E2E test suite for the new DMN Editor - Part 3 [incubator-kie-tools]
ljmotta opened a new pull request, #2211:
URL: https://github.com/apache/incubator-kie-tools/pull/2211
Related to https://github.com/apache/incubator-kie-issues/issues/946
This PR continues the exploratory phase and continue the work started on https://github.com/apache/incubator-kie-tools/pull/2158
## Description
This PR creates introduce and fix a few things:
- Use the `transform` over `zoom` due to Playwright compatibility.
- Set a `y` offset to the viewport.
- Remove `variable` from Knowledge Source nodes.
- Add `add[Edge]Waypoint` tests.
- Add `delete[Edge]Waypoint` tests.
- Add `invalid[Edge]` tests.
- Add jsonModel validation for simple cases.
## Improvements for the next interation
- Add Decision Service node tests
- Add property panel tests
- Add resize node tests
- Improve json model fixture and tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#946: Action plan - Exploratory phase of the strategy for implementing the E2E test suite for the new DMN Editor - Part 3 [incubator-kie-tools]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2211:
URL: https://github.com/apache/incubator-kie-tools/pull/2211#discussion_r1540660222
##########
packages/dmn-editor/tests/e2e/__fixtures__/nodes.ts:
##########
@@ -173,6 +164,12 @@ export class Nodes {
return this.get({ name: args.name }).locator("span", { hasText: args.name }).dblclick();
}
+ public async startDraggingEdge(args: { from: string; edgeType: EdgeType }) {
+ await this.select({ name: args.from, position: NodePosition.TOP });
+ await this.get({ name: args.from }).getByTitle(this.getAddEdgeTitle(args.edgeType)).hover();
+ await this.page.mouse.down();
+ }
Review Comment:
```suggestion
/**
* Used for testing invalid edges. No edge is created using this method.
*/
public async startDraggingEdge(args: { from: string; edgeType: EdgeType }) {
await this.select({ name: args.from, position: NodePosition.TOP });
await this.get({ name: args.from }).getByTitle(this.getAddEdgeTitle(args.edgeType)).hover();
await this.page.mouse.down();
}
```
##########
packages/dmn-editor/tests/e2e/__fixtures__/jsonModel/drgElements.ts:
##########
@@ -0,0 +1,387 @@
+/*
+ * 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 { DmnLatestModel } from "@kie-tools/dmn-marshaller";
+import {
+ DMN15__tBusinessKnowledgeModel,
+ DMN15__tDecision,
+ DMN15__tDecisionService,
+ DMN15__tDefinitions,
+ DMN15__tInputData,
+ DMN15__tKnowledgeSource,
+ DMNDI15__DMNDiagram,
+ DMNDI15__DMNShape,
+} from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
+import { Page } from "@playwright/test";
+import { STORYBOOK__DMN_EDITOR_MODEL } from "../jsonModel";
+
+type AllDrgElements = NonNullable<DMN15__tDefinitions["drgElement"]>[0];
+
+export enum DataType {
+ Undefined = "<Undefined>",
+ Any = "Any",
+ Boolean = "boolean",
+ Context = "context",
+ Date = "date",
+ DateTime = "date and time",
+ DateTimeDuration = "days and time duration",
+ Number = "number",
+ String = "string",
+ Time = "time",
+ YearsMonthsDuration = "years and months duration",
+}
Review Comment:
I think we have this in `__fixtures__/jsonModel.ts`
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidAuthorityRequirement.spec.ts:
##########
@@ -0,0 +1,172 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Authority Requirement", () => {
+ test.describe("Invalid edge - Authority Requirement - From Knowledge Source", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Input Data node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.AUTHORITY_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.INPUT_DATA,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.INPUT_DATA })).not.toBeAttached();
+ });
+
+ test("should dim the target Input Data node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("should dim the target Alternative Input Data node", async ({ diagram, palette, nodes }) => {
+ await diagram.selectAlternativeInputDataShape();
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Decision Service node", async ({
Review Comment:
```suggestion
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Decision Service node", async ({
```
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidKnowledgeRequirement.spec.ts:
##########
@@ -0,0 +1,171 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Knowledge Requirement", () => {
+ test.describe("Invalid edge - Knowledge Requirement - From BKM", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.BKM,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Input Data node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.KNOWLEDGE_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.INPUT_DATA,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.INPUT_DATA })).not.toBeAttached();
+ });
+
+ test("should dim the target Input Data node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("should dim the target Alternative Input Data node", async ({ diagram, palette, nodes }) => {
+ await diagram.selectAlternativeInputDataShape();
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Knowledge Source node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.KNOWLEDGE_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.KNOWLEDGE_SOURCE,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.KNOWLEDGE_SOURCE })).not.toBeAttached();
+ });
+
+ test("should dim the target Knowledge Source node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.KNOWLEDGE_SOURCE })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Group node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.GROUP,
+ targetPosition: { x: 400, y: 400 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.KNOWLEDGE_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.GROUP,
+ position: NodePosition.TOP,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.GROUP })).not.toBeAttached();
+ });
+
+ test("should dim the target Group node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.GROUP,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.GROUP })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Text Annotation node", async ({
Review Comment:
```suggestion
test("shouldn't add an Knowledge Requirement edge from BKM node to Text Annotation node", async ({
```
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidAuthorityRequirement.spec.ts:
##########
@@ -0,0 +1,172 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Authority Requirement", () => {
+ test.describe("Invalid edge - Authority Requirement - From Knowledge Source", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Input Data node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.AUTHORITY_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.INPUT_DATA,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.INPUT_DATA })).not.toBeAttached();
+ });
+
+ test("should dim the target Input Data node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("should dim the target Alternative Input Data node", async ({ diagram, palette, nodes }) => {
+ await diagram.selectAlternativeInputDataShape();
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Decision Service node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.DECISION_SERVICE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.AUTHORITY_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.DECISION_SERVICE,
+ position: NodePosition.TOP,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.DECISION_SERVICE })).not.toBeAttached();
+ });
+
+ test("should dim the target Decision Service node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.DECISION_SERVICE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.DECISION_SERVICE })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Group node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.GROUP,
+ targetPosition: { x: 400, y: 400 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.AUTHORITY_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.GROUP,
+ position: NodePosition.TOP,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.GROUP })).not.toBeAttached();
+ });
+
+ test("should dim the target Group node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.GROUP,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.GROUP })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Text Annotation node", async ({
Review Comment:
```suggestion
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Text Annotation node", async ({
```
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidAuthorityRequirement.spec.ts:
##########
@@ -0,0 +1,172 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Authority Requirement", () => {
+ test.describe("Invalid edge - Authority Requirement - From Knowledge Source", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Input Data node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.AUTHORITY_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.INPUT_DATA,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.INPUT_DATA })).not.toBeAttached();
+ });
+
+ test("should dim the target Input Data node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("should dim the target Alternative Input Data node", async ({ diagram, palette, nodes }) => {
+ await diagram.selectAlternativeInputDataShape();
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Decision Service node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.DECISION_SERVICE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.AUTHORITY_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.DECISION_SERVICE,
+ position: NodePosition.TOP,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.DECISION_SERVICE })).not.toBeAttached();
+ });
+
+ test("should dim the target Decision Service node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.DECISION_SERVICE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.DECISION_SERVICE })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Group node", async ({
Review Comment:
```suggestion
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Group node", async ({
```
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidAuthorityRequirement.spec.ts:
##########
@@ -0,0 +1,172 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Authority Requirement", () => {
+ test.describe("Invalid edge - Authority Requirement - From Knowledge Source", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Authority Requirement edge from Input Data node to Input Data node", async ({
Review Comment:
```suggestion
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Input Data node", async ({
```
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidKnowledgeRequirement.spec.ts:
##########
@@ -0,0 +1,171 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Knowledge Requirement", () => {
+ test.describe("Invalid edge - Knowledge Requirement - From BKM", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.BKM,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Input Data node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.KNOWLEDGE_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.INPUT_DATA,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.INPUT_DATA })).not.toBeAttached();
+ });
+
+ test("should dim the target Input Data node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("should dim the target Alternative Input Data node", async ({ diagram, palette, nodes }) => {
+ await diagram.selectAlternativeInputDataShape();
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Knowledge Source node", async ({
Review Comment:
```suggestion
test("shouldn't add an Knowledge Requirement edge from BKM node to Knowledge Source node", async ({
```
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidKnowledgeRequirement.spec.ts:
##########
@@ -0,0 +1,171 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Knowledge Requirement", () => {
+ test.describe("Invalid edge - Knowledge Requirement - From BKM", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.BKM,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Input Data node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.KNOWLEDGE_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.INPUT_DATA,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.INPUT_DATA })).not.toBeAttached();
+ });
+
+ test("should dim the target Input Data node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("should dim the target Alternative Input Data node", async ({ diagram, palette, nodes }) => {
+ await diagram.selectAlternativeInputDataShape();
+ await palette.dragNewNode({
+ type: NodeType.INPUT_DATA,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Knowledge Source node", async ({
+ palette,
+ nodes,
+ edges,
+ }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.dragNewConnectedEdge({
+ type: EdgeType.KNOWLEDGE_REQUIREMENT,
+ from: "Source Node",
+ to: DefaultNodeName.KNOWLEDGE_SOURCE,
+ });
+
+ expect(await edges.get({ from: "Source Node", to: DefaultNodeName.KNOWLEDGE_SOURCE })).not.toBeAttached();
+ });
+
+ test("should dim the target Knowledge Source node", async ({ palette, nodes }) => {
+ await palette.dragNewNode({
+ type: NodeType.KNOWLEDGE_SOURCE,
+ targetPosition: { x: 300, y: 100 },
+ });
+
+ await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });
+
+ await expect(nodes.get({ name: DefaultNodeName.KNOWLEDGE_SOURCE })).toHaveClass(/.*dimmed/);
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Group node", async ({
Review Comment:
```suggestion
test("shouldn't add an Knowledge Requirement edge from BKM node to Group node", async ({
```
##########
packages/dmn-editor/tests/e2e/drgRequirements/invalidKnowledgeRequirement.spec.ts:
##########
@@ -0,0 +1,171 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodePosition, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+
+test.beforeEach(async ({ editor }) => {
+ await editor.open();
+});
+
+test.describe("Invalid edge - Knowledge Requirement", () => {
+ test.describe("Invalid edge - Knowledge Requirement - From BKM", () => {
+ test.beforeEach(async ({ palette }) => {
+ await palette.dragNewNode({
+ type: NodeType.BKM,
+ targetPosition: { x: 100, y: 100 },
+ thenRenameTo: "Source Node",
+ });
+ });
+
+ test("shouldn't add an Knowledge Requirement edge from Input Data node to Input Data node", async ({
Review Comment:
```suggestion
test("shouldn't add an Knowledge Requirement edge from BKM node to Input Data node", async ({
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#946: Action plan - Exploratory phase of the strategy for implementing the E2E test suite for the new DMN Editor - Part 3 [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on PR #2211:
URL: https://github.com/apache/incubator-kie-tools/pull/2211#issuecomment-2048617504
#2230 merged. I already re-triggered the CI here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#946: Action plan - Exploratory phase of the strategy for implementing the E2E test suite for the new DMN Editor - Part 3 [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento merged PR #2211:
URL: https://github.com/apache/incubator-kie-tools/pull/2211
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#946: Action plan - Exploratory phase of the strategy for implementing the E2E test suite for the new DMN Editor - Part 3 [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on PR #2211:
URL: https://github.com/apache/incubator-kie-tools/pull/2211#issuecomment-2025794614
@ljmotta Looking at the `jsonModel.ts` fixture you introduced, I have a couple of thoughts:
1. The wait mechanism is flawed, we can do better with a new optional prop called `onModelDebounceStateChanged` only render the JSON once debounce is completed.
2. The `drgElements.ts` file has too much logic. IMHO we shouldn't be abstracting direct access to the JSON model itself. IMHO it's alright to use hard-coded indexes to find stuff in the array, as we expect that the JSON model will be stable.
3. The strategy of using the DOM to make the JSON available to the tests is a clever hack, well done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#946: Action plan - Exploratory phase of the strategy for implementing the E2E test suite for the new DMN Editor - Part 3 [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on PR #2211:
URL: https://github.com/apache/incubator-kie-tools/pull/2211#issuecomment-2046105514
@ljmotta I'm having the exact same problem at #2230, I'll fix it there and this PR should go back to working normally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org