jomarko commented on code in PR #2158:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2158#discussion_r1489307936


##########
packages/dmn-editor/tests/e2e/connections/betweenTwoExistingNodes.spec.ts:
##########
@@ -0,0 +1,191 @@
+/*
+ * 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 "@playwright/test";
+import { env } from "../../../env";
+
+test.beforeEach(async ({ page }, testInfo) => {
+  await page.goto(
+    
`http://localhost:${env.dmnEditor.storybook.port}/iframe.html?args=&id=example-dmndevwebapp--empty-model&viewMode=story`
+  );
+});
+
+test.describe("Connect two existing nodes", () => {
+  test("InputData -> Decision", async ({ page }) => {
+    // Add two nodes
+    await page
+      .getByTitle("Decision", { exact: true })
+      .dragTo(page.getByTestId("rf__wrapper"), { targetPosition: { x: 100, y: 
100 } });
+    await page
+      .getByTitle("Input Data", { exact: true })
+      .dragTo(page.getByTestId("rf__wrapper"), { targetPosition: { x: 100, y: 
300 } });
+
+    // Connect these nodes
+    // await page.getByText("New Input Data").hover();
+    await 
page.getByTitle("edge_informationRequirement").locator("visible=true").dragTo(page.getByText("New
 Decision"));
+
+    expect(await page.screenshot()).toMatchSnapshot();
+  });

Review Comment:
   each test has currently the same structure, so I will write my questions 
attaching to one of them
   - drag some elements
   - make a snapshot comparision
   
   - should we somehow avoid using coordinates where we want to drag the nodes? 
I mean `targetPosition`, should it be somehow automatically computed?
   - any idea how to avoid using `rf__wrapper` locator ? it was the only id, 
that I find for dragging elements into react flow panel.
   - `hover()` seems to be problematic, on some tests it timeouts, in some not, 
do you have any experience with `hover()`, is there some 
   - the current test suite is to check, each connection type can be created,  
each (most important) combinations, of nodes can be connected, Decision 
Services missing for now. Want to see what do you think about the tests. Do you 
have in mind how to check connection was created, other that doing a screenshot 
in the end of the test? In older kie tests suites we were checking produced 
DMN/XML file.
   - if we go with screenshots/snapshots, should we eliminate their amount? 
currently each test has specific screenshot per browser



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to