kbowers-ibm commented on code in PR #2188:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2188#discussion_r1531600263


##########
packages/scesim-editor/tests/e2e/features/keyboard/keyboard.spec.ts:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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 { expect, test } from "../../__fixtures__/base";
+import { AssetType } from "../../__fixtures__/editor";
+import { AddRowPosition, Type } from "../../__fixtures__/table";
+
+test.describe("Keyboard", () => {
+  test.describe("Keyboard-Shortcuts Navigation", () => {
+    test("should correctly navigate the page using keyboard shortcuts", async 
({
+      editor,
+      table,
+      testScenarioTable,
+    }) => {
+      await editor.createTestScenario(AssetType.RULE);
+      await table.addRow({ targetCell: "1", position: AddRowPosition.BELOW });
+      await table.addRow({ targetCell: "1", position: AddRowPosition.BELOW });
+      await table.addRow({ targetCell: "1", position: AddRowPosition.BELOW });
+      await table.selectCell({ rowNumber: "1", columnNumber: 0 });
+      await table.navigateRight({ rowNumber: "1", columnNumber: 0, type: 
Type.KEYBOARD_SHORTCUT });
+      await 
expect(testScenarioTable.get()).toHaveScreenshot("navigation-screenshot-right.png",
 {
+        maxDiffPixels: 1000,

Review Comment:
   When I didn't use maxDiffPixels, the screenshot passed even when I gave the 
incorrect screenshots, e.g. when I used the navigation-screenshot-left where 
the navigation-screenshot-right should be, even though a different cell is 
selected in that screenshot, the test still passed. I tried experimenting with 
some other "assertions," e.g. toBeFocused, toHaveAttribute/id/css, etc. but 
couldn't get it to work in a way that I was happy with



-- 
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