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


##########
packages/scesim-editor/.gitignore:
##########


Review Comment:
   Remove



##########
packages/scesim-editor/dev-webapp/src/ExternalScesimModels.ts:
##########
@@ -0,0 +1,1150 @@
+/*
+ * 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.
+ */
+
+export const IS_OLD_ENOUGH_RULE = `<ScenarioSimulationModel version="1.8" 
xmlns="https://kie.org/scesim/1.8";>

Review Comment:
   Move this XML to its own story and import on the DevWebApp from there.



##########
packages/scesim-editor/stories/dev/DevWebApp.stories.tsx:
##########


Review Comment:
   Please refer to the https://github.com/apache/incubator-kie-tools/pull/2189 
to create the DevWebApp story full compatible with the Storybook properties 
table.
   
   You need to create a wrapper component such as 
https://github.com/apache/incubator-kie-tools/pull/2189/files#diff-6764f41c24dc05518be178771e2a8306063177c5cd890bd93651cda3e92bd738
 and use it as a function like: 
https://github.com/apache/incubator-kie-tools/pull/2189/files#diff-85f726b3adfc250eb269c668d04f39cdbddd6e3076892175ecd767a46ed909d1R192



##########
packages/scesim-editor/tests/e2e/features/keyboard/keyboard.spec.ts:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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";
+
+test.describe("Keyboard", () => {
+  test.describe("Navigation", () => {
+    test("should correctly navigate", async () => {
+      // enter, shift+enter, tab, shift+tab, escape
+      // currently not working in playwright
+    });
+  });
+
+  test.describe("Arrow Key Navigation", () => {
+    test("should correctly navigate the page using arrow keys", async ({ 
stories, page }) => {
+      await stories.openTestScenarioTableDecision();
+      await page.getByRole("cell", { name: "1" }).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();

Review Comment:
   Why it require three clicks? It's adding rows? What about creating a fixture 
`table` with one `addRow`?



##########
packages/scesim-editor/tests/e2e/scesimEditor/Decision/TestScenario/populate.spec.ts:
##########
@@ -0,0 +1,129 @@
+/*
+ * 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";
+
+test.describe("Populate Decision Test Scenario table", () => {
+  test("should correctly populate a test scenario table", async ({ stories, 
page, resizing }) => {
+    await stories.openTestScenarioTableDecision();
+    await page.getByTestId("monaco-container").first().click();
+    await page.getByTestId("monaco-container").first().press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("Scenario one");
+    await page.getByTestId("monaco-container").nth(1).click();
+    await page.getByTestId("monaco-container").nth(1).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("date and time(5, 10)");
+    await page.getByText("date and time(5, 10)date and time(5, 
10)").press("Tab");
+    await page.getByTestId("monaco-container").nth(2).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("100");
+    await resizing.reset(page.getByRole("columnheader", { name: "GIVEN" }));
+    await page.getByRole("columnheader", { name: "GIVEN" }).hover({ position: 
{ x: 0, y: 0 } });
+    await page
+      .getByRole("cell", { name: "date and time(5, 10) date and time(5, 10)" })
+      .getByTestId("monaco-container")
+      .click();
+    await page.getByText("date and time(5, 10)date and time(5, 
10)").press("ArrowLeft");
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();

Review Comment:
   same



##########
packages/scesim-editor/tests/e2e/scesimEditor/Decision/Background/populate.spec.ts:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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";
+
+test.describe("Populate Decision Background table", () => {
+  test("should correctly populate a background table", async ({ stories, page, 
resizing }) => {
+    await stories.openBackgroundTableDecision();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("{foo}");
+    await page.getByRole("columnheader", { name: "PROPERTY (<Undefined>)" 
}).click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(1).click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(1).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("[foo]");
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(2).click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(2).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill('"foo"');
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(3).click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(3).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill(",./123981275980172957129517");
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(4).click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(4).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("{foo}{foo}f");
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(5).click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").nth(5).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("=1-205=-1205=-0125-0215215");

Review Comment:
   Some additional lines would help read this block



##########
packages/scesim-editor/env/index.js:
##########
@@ -27,6 +27,9 @@ module.exports = 
composeEnv([require("@kie-tools/root-env/env")], {
         dev: {
           port: 9004,
         },
+        storybook: {
+          port: 9902,

Review Comment:
   Use string



##########
packages/scesim-editor/dev-webapp/src/ExternalScesimModels.ts:
##########


Review Comment:
   Rename to lower case starting letter



##########
packages/scesim-editor/tests/e2e/scesimEditor/Rule/Background/populate.spec.ts:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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";
+
+test.describe("Populate Rule Background table", () => {
+  test("should correctly populate a background table", async ({ stories, page, 
resizing }) => {
+    await stories.openBackgroundTableRule();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("{foo}");
+    await page.getByRole("columnheader", { name: "PROPERTY (<Undefined>)" 
}).click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();

Review Comment:
   Same



##########
packages/scesim-editor/env/index.js:
##########
@@ -27,6 +27,9 @@ module.exports = 
composeEnv([require("@kie-tools/root-env/env")], {
         dev: {

Review Comment:
   You can remove this one.



##########
packages/scesim-editor/dev-webapp/src/ExternalScesimModels.ts:
##########
@@ -0,0 +1,1150 @@
+/*
+ * 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.
+ */
+
+export const IS_OLD_ENOUGH_RULE = `<ScenarioSimulationModel version="1.8" 
xmlns="https://kie.org/scesim/1.8";>
+<simulation>
+  <scesimModelDescriptor>
+    <factMappings>
+      <FactMapping>
+        <expressionElements/>
+        <expressionIdentifier>
+          <name>Index</name>
+          <type>OTHER</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>#</name>
+          <className>java.lang.Integer</className>
+        </factIdentifier>
+        <className>java.lang.Integer</className>
+        <factAlias>#</factAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>70.0</columnWidth>
+      </FactMapping>
+      <FactMapping>
+        <expressionElements/>
+        <expressionIdentifier>
+          <name>Description</name>
+          <type>OTHER</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>Scenario description</name>
+          <className>java.lang.String</className>
+        </factIdentifier>
+        <className>java.lang.String</className>
+        <factAlias>Scenario description</factAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>300.0</columnWidth>
+      </FactMapping>
+      <FactMapping>
+        <expressionElements>
+          <ExpressionElement>
+            <step>Applicant</step>
+          </ExpressionElement>
+          <ExpressionElement>
+            <step>age</step>
+          </ExpressionElement>
+        </expressionElements>
+        <expressionIdentifier>
+          <name>1|1</name>
+          <type>GIVEN</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>1|1</name>
+          <className>mortgages.mortgages.Applicant</className>
+        </factIdentifier>
+        <className>java.lang.Integer</className>
+        <factAlias>Applicant</factAlias>
+        <expressionAlias>age</expressionAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>212.60000000000002</columnWidth>
+      </FactMapping>
+      <FactMapping>
+        <expressionElements>
+          <ExpressionElement>
+            <step>LoanApplication</step>
+          </ExpressionElement>
+          <ExpressionElement>
+            <step>approved</step>
+          </ExpressionElement>
+        </expressionElements>
+        <expressionIdentifier>
+          <name>1591876615315</name>
+          <type>GIVEN</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>1591622209590</name>
+          <className>mortgages.mortgages.LoanApplication</className>
+        </factIdentifier>
+        <className>java.lang.Boolean</className>
+        <factAlias>LoanApplication</factAlias>
+        <expressionAlias>approved</expressionAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>212.60000000000002</columnWidth>
+      </FactMapping>
+      <FactMapping>
+        <expressionElements>
+          <ExpressionElement>
+            <step>IncomeSource</step>
+          </ExpressionElement>
+          <ExpressionElement>
+            <step>amount</step>
+          </ExpressionElement>
+        </expressionElements>
+        <expressionIdentifier>
+          <name>1591622221147</name>
+          <type>GIVEN</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>1591622221147</name>
+          <className>mortgages.mortgages.IncomeSource</className>
+        </factIdentifier>
+        <className>java.lang.Integer</className>
+        <factAlias>IncomeSource</factAlias>
+        <expressionAlias>amount</expressionAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>212.60000000000002</columnWidth>
+      </FactMapping>
+      <FactMapping>
+        <expressionElements>
+          <ExpressionElement>
+            <step>LoanApplication</step>
+          </ExpressionElement>
+          <ExpressionElement>
+            <step>approved</step>
+          </ExpressionElement>
+        </expressionElements>
+        <expressionIdentifier>
+          <name>1|2</name>
+          <type>EXPECT</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>1591622209590</name>
+          <className>mortgages.mortgages.LoanApplication</className>
+        </factIdentifier>
+        <className>java.lang.Boolean</className>
+        <factAlias>LoanApplication</factAlias>
+        <expressionAlias>approved</expressionAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>212.60000000000002</columnWidth>
+      </FactMapping>
+      <FactMapping>
+        <expressionElements>
+          <ExpressionElement>
+            <step>LoanApplication</step>
+          </ExpressionElement>
+          <ExpressionElement>
+            <step>explanation</step>
+          </ExpressionElement>
+        </expressionElements>
+        <expressionIdentifier>
+          <name>1591874776961</name>
+          <type>EXPECT</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>1591622209590</name>
+          <className>mortgages.mortgages.LoanApplication</className>
+        </factIdentifier>
+        <className>java.lang.String</className>
+        <factAlias>LoanApplication</factAlias>
+        <expressionAlias>explanation</expressionAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>212.60000000000002</columnWidth>
+      </FactMapping>
+    </factMappings>
+  </scesimModelDescriptor>
+  <scesimData>
+    <Scenario>
+      <factMappingValues>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>Scenario description</name>
+            <className>java.lang.String</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>Description</name>
+            <type>OTHER</type>
+          </expressionIdentifier>
+          <rawValue class="string">Young Bob want a loan</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>#</name>
+            <className>java.lang.Integer</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>Index</name>
+            <type>OTHER</type>
+          </expressionIdentifier>
+          <rawValue class="string">1</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1|1</name>
+            <className>mortgages.mortgages.Applicant</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1|1</name>
+            <type>GIVEN</type>
+          </expressionIdentifier>
+          <rawValue class="string">17</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622221147</name>
+            <className>mortgages.mortgages.IncomeSource</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1591622221147</name>
+            <type>GIVEN</type>
+          </expressionIdentifier>
+          <rawValue class="string">0</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622209590</name>
+            <className>mortgages.mortgages.LoanApplication</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1|2</name>
+            <type>EXPECT</type>
+          </expressionIdentifier>
+          <rawValue class="string">false</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622209590</name>
+            <className>mortgages.mortgages.LoanApplication</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1591874776961</name>
+            <type>EXPECT</type>
+          </expressionIdentifier>
+          <rawValue class="string">Underage</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622209590</name>
+            <className>mortgages.mortgages.LoanApplication</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1591876615315</name>
+            <type>GIVEN</type>
+          </expressionIdentifier>
+          <rawValue class="string">true</rawValue>
+        </FactMappingValue>
+      </factMappingValues>
+    </Scenario>
+    <Scenario>
+      <factMappingValues>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>Scenario description</name>
+            <className>java.lang.String</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>Description</name>
+            <type>OTHER</type>
+          </expressionIdentifier>
+          <rawValue class="string">Adult Anna  want a loan</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>#</name>
+            <className>java.lang.Integer</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>Index</name>
+            <type>OTHER</type>
+          </expressionIdentifier>
+          <rawValue class="string">2</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1|1</name>
+            <className>mortgages.mortgages.Applicant</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1|1</name>
+            <type>GIVEN</type>
+          </expressionIdentifier>
+          <rawValue class="string">27</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622221147</name>
+            <className>mortgages.mortgages.IncomeSource</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1591622221147</name>
+            <type>GIVEN</type>
+          </expressionIdentifier>
+          <rawValue class="string">0</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622209590</name>
+            <className>mortgages.mortgages.LoanApplication</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1|2</name>
+            <type>EXPECT</type>
+          </expressionIdentifier>
+          <rawValue class="string">true</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622209590</name>
+            <className>mortgages.mortgages.LoanApplication</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1591874776961</name>
+            <type>EXPECT</type>
+          </expressionIdentifier>
+          <rawValue class="string">null</rawValue>
+        </FactMappingValue>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>1591622209590</name>
+            <className>mortgages.mortgages.LoanApplication</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1591876615315</name>
+            <type>GIVEN</type>
+          </expressionIdentifier>
+          <rawValue class="string">true</rawValue>
+        </FactMappingValue>
+      </factMappingValues>
+    </Scenario>
+  </scesimData>
+</simulation>
+<background>
+  <scesimModelDescriptor>
+    <factMappings>
+      <FactMapping>
+        <expressionElements/>
+        <expressionIdentifier>
+          <name>1|1</name>
+          <type>GIVEN</type>
+        </expressionIdentifier>
+        <factIdentifier>
+          <name>Empty</name>
+          <className>java.lang.Void</className>
+        </factIdentifier>
+        <className>java.lang.Void</className>
+        <factAlias>INSTANCE 1</factAlias>
+        <expressionAlias>PROPERTY 1</expressionAlias>
+        <factMappingValueType>NOT_EXPRESSION</factMappingValueType>
+        <columnWidth>114.0</columnWidth>
+      </FactMapping>
+    </factMappings>
+  </scesimModelDescriptor>
+  <scesimData>
+    <BackgroundData>
+      <factMappingValues>
+        <FactMappingValue>
+          <factIdentifier>
+            <name>Empty</name>
+            <className>java.lang.Void</className>
+          </factIdentifier>
+          <expressionIdentifier>
+            <name>1|1</name>
+            <type>GIVEN</type>
+          </expressionIdentifier>
+        </FactMappingValue>
+      </factMappingValues>
+    </BackgroundData>
+  </scesimData>
+</background>
+<settings>
+  <type>RULE</type>
+  <skipFromBuild>false</skipFromBuild>
+  <stateless>false</stateless>
+</settings>
+<imports>
+  <imports/>
+</imports>
+</ScenarioSimulationModel>
+`;
+
+export const TRAFFIC_VIOLATION_DMN = `<?xml version="1.0" encoding="UTF-8"?>

Review Comment:
   Same



##########
packages/scesim-editor/package.json:
##########
@@ -7,10 +7,16 @@
   "scripts": {
     "build:dev": "rimraf dist && tsc -p tsconfig.json",
     "build:prod": "rimraf dist && pnpm lint && tsc -p tsconfig.json && pnpm 
test && pnpm test:e2e",
+    "build:storybook": "storybook build -o dist-storybook",
     "lint": "run-script-if --bool \"$(build-env linters.run)\" --then 
\"kie-tools--eslint ./src\"",
-    "start": "webpack serve -c ./dev-webapp/webpack.config.js --host 0.0.0.0 
--env dev",
-    "test": "echo 'No Tests to run at this moment.'",
-    "test:e2e": "echo 'No IT Tests to run at this moment.'"
+    "powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted 
-Command",
+    "start": "run-script-os",
+    "start:linux:darwin": "cross-env STORYBOOK_PORT=$(build-env 
scesimEditor.storybook.port) pnpm storybook-base --storybookArgs=\"dev 
--no-open\"",
+    "start:win32": "pnpm powershell \"cross-env STORYBOOK_PORT=$(build-env 
scesimEditor.storybook.port) pnpm storybook-base --storybookArgs='dev 
--no-open'",
+    "test": "run-script-if --ignore-errors \"$(build-env 
tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest 
--silent --verbose --passWithNoTests\"",
+    "test:e2e": "run-script-if --ignore-errors \"$(build-env 
endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" 
--then \"pnpm rimraf ./dist-e2e\" \"pnpm test:e2e:run\"",

Review Comment:
   ```suggestion
       "test:e2e": "run-script-if --ignore-errors \"$(build-env 
endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" 
--then \"pnpm rimraf ./dist-e2e-tests\" \"pnpm test:e2e:run\"",
   ```



##########
packages/scesim-editor/stories/misc/Empty/EmptyEditor.mdx:
##########
@@ -0,0 +1,50 @@
+{/* 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 { Meta, Story } from "@storybook/blocks";
+import * as EmptyEditor from "./EmptyEditor.stories";
+
+<Meta title="MDX/Empty Expression" of={EmptyEditor} />

Review Comment:
   Change to Empty Editor?



##########
packages/scesim-editor/tests/e2e/__screenshots__/chromium/misc/emptyExpression/create-a-new-test-scenario.png:
##########


Review Comment:
   I guess one piece was cut off?



##########
packages/scesim-editor/tests/e2e/features/keyboard/keyboard.spec.ts:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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";
+
+test.describe("Keyboard", () => {
+  test.describe("Navigation", () => {
+    test("should correctly navigate", async () => {
+      // enter, shift+enter, tab, shift+tab, escape
+      // currently not working in playwright

Review Comment:
   Please add the tests steps and a `test.skip` to it with a Regression 
`annotation` if you wish to keep this test. Alternatively, you can track it on 
some issue and remove this test.
   
   Refer to: 
https://github.com/apache/incubator-kie-tools/blob/main/packages/boxed-expression-component/tests/e2e/boxedExpressions/invocation/contextMenu.spec.ts#L106-L110



##########
packages/scesim-editor/playwright.config.ts:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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 { defineConfig } from "@playwright/test";
+import playwrightBaseConfig from 
"@kie-tools/playwright-base/playwright.config";
+import merge from "lodash/merge";
+import { env } from "./env";
+
+const buildEnv: any = env;
+
+const customConfig = defineConfig({
+  use: {
+    baseURL: `http://localhost:${buildEnv.scesimEditor.storybook.port}`,
+    launchOptions: {
+      // 1
+      args: ["--start-maximized"],

Review Comment:
   I guess this can be removed?



##########
packages/scesim-editor/tests/e2e/features/keyboard/keyboard.spec.ts:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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";
+
+test.describe("Keyboard", () => {
+  test.describe("Navigation", () => {
+    test("should correctly navigate", async () => {
+      // enter, shift+enter, tab, shift+tab, escape
+      // currently not working in playwright
+    });
+  });
+
+  test.describe("Arrow Key Navigation", () => {
+    test("should correctly navigate the page using arrow keys", async ({ 
stories, page }) => {
+      await stories.openTestScenarioTableDecision();
+      await page.getByRole("cell", { name: "1" }).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("row", { name: "1", exact: true }).click();
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowRight");
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowRight");
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowLeft");
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowLeft");
+      await page.getByRole("row", { name: "3", exact: true }).press("ArrowUp");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowRight");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "3", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "4", exact: true }).press("Enter");
+      await page
+        .getByLabel("Editor content;Press Alt+F1 for Accessibility Options.")
+        .fill("This text should go in the 4th row, 2nd column");
+      await expect(page.getByLabel("Test 
Scenario")).toHaveScreenshot("navigation-arrow-screenshot.png");

Review Comment:
   The screenshot doens't show the entire text, I guess it's missing a enter?



##########
packages/scesim-editor/tests/e2e/scesimEditor/Decision/Background/populate.spec.ts:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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";
+
+test.describe("Populate Decision Background table", () => {
+  test("should correctly populate a background table", async ({ stories, page, 
resizing }) => {
+    await stories.openBackgroundTableDecision();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").click();
+    await 
page.getByLabel("Background").getByTestId("monaco-container").press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("{foo}");
+    await page.getByRole("columnheader", { name: "PROPERTY (<Undefined>)" 
}).click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();
+    await page.getByLabel("Background").locator("path").click();

Review Comment:
   The same as the `addRow`, but I guess it's adding columns? Also, it's not 
possible to use something better than the "path"?



##########
packages/scesim-editor/tests/e2e/misc/emptyExpression/emptyExpression.spec.ts:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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";
+
+test.describe("Empty Editor", () => {
+  test("should render editor correctly", async ({ stories, page }) => {
+    await stories.openSelectionPage();
+    await expect(
+      page.getByText("Create a new Test ScenarioAsset type * Select a 
typeDecision (DMN)Rule (DRL)Skip")
+    ).toHaveScreenshot("create-a-new-test-scenario.png");
+    await page.locator("#asset-type-select").selectOption("DMN");
+    await page.getByRole("button", { name: "Create" }).click();

Review Comment:
   I think this can be put inside a fixture, as it will be used a lot accross 
the tests. (not the screenshot, as it require a specific test for it)



##########
packages/scesim-editor/stories/misc/Empty/EmptyEditor.stories.tsx:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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 type { Meta, StoryObj } from "@storybook/react";
+import { DevWebApp } from "../../../dev-webapp/src/DevWebApp";
+
+// More on how to set up stories at: 
https://storybook.js.org/docs/react/writing-stories/introduction#default-export
+const meta: Meta<typeof DevWebApp> = {
+  title: "Misc/Empty SceSim Editor",
+  component: DevWebApp,
+  includeStories: /^[A-Z]/,
+};
+export default meta;
+type Story = StoryObj<typeof DevWebApp>;
+
+export const Base: Story = {

Review Comment:
   Create the Empty story using the wrapper for the DevWebApp.



##########
packages/scesim-editor/tests/e2e/features/keyboard/keyboard.spec.ts:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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";
+
+test.describe("Keyboard", () => {
+  test.describe("Navigation", () => {
+    test("should correctly navigate", async () => {
+      // enter, shift+enter, tab, shift+tab, escape
+      // currently not working in playwright
+    });
+  });
+
+  test.describe("Arrow Key Navigation", () => {
+    test("should correctly navigate the page using arrow keys", async ({ 
stories, page }) => {
+      await stories.openTestScenarioTableDecision();
+      await page.getByRole("cell", { name: "1" }).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("cell", { name: "1" 
}).locator("div").nth(1).click();
+      await page.getByRole("row", { name: "1", exact: true }).click();
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowRight");
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowRight");
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowLeft");
+      await page.getByRole("row", { name: "1", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowLeft");
+      await page.getByRole("row", { name: "3", exact: true }).press("ArrowUp");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowRight");
+      await page.getByRole("row", { name: "2", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "3", exact: true 
}).press("ArrowDown");
+      await page.getByRole("row", { name: "4", exact: true }).press("Enter");

Review Comment:
   It's not possible to get the selected cell instead of walking through the 
specific cells? I mean, this way you don't need to specify the cell name.



##########
packages/scesim-editor/tests/e2e/scesimEditor/Rule/TestScenario/populate.spec.ts:
##########
@@ -0,0 +1,129 @@
+/*
+ * 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";
+
+test.describe("Populate Rule Test Scenario table", () => {
+  test("should correctly populate a test scenario table", async ({ stories, 
page, resizing }) => {
+    await stories.openTestScenarioTableRule();
+    await page.getByTestId("monaco-container").first().click();
+    await page.getByTestId("monaco-container").first().press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("Scenario one");
+    await page.getByTestId("monaco-container").nth(1).click();
+    await page.getByTestId("monaco-container").nth(1).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("date and time(5, 10)");
+    await page.getByText("date and time(5, 10)date and time(5, 
10)").press("Tab");
+    await page.getByTestId("monaco-container").nth(2).press("Enter");
+    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility 
Options.").fill("100");
+    await resizing.reset(page.getByRole("columnheader", { name: "GIVEN" }));
+    await page.getByRole("columnheader", { name: "GIVEN" }).hover({ position: 
{ x: 0, y: 0 } });
+    await page
+      .getByRole("cell", { name: "date and time(5, 10) date and time(5, 10)" })
+      .getByTestId("monaco-container")
+      .click();
+    await page.getByText("date and time(5, 10)date and time(5, 
10)").press("ArrowLeft");
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();
+    await page.getByRole("cell", { name: "1", exact: true 
}).locator("div").nth(1).click();

Review Comment:
   Same



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