apache / incubator-kie-issues

Apache License 2.0
11 stars 1 forks source link

Create E2E tests API and some test cases for the DMN Boxed Expression Editor #1369

Open danielzhe opened 4 days ago

danielzhe commented 4 days ago

The problem: In DMN Boxed Expression Editor, we are using Playwright to write E2E tests, which can be a bit verbose and hard to write new tests with a lot of copy-paste of code.

For example, consider the code below to add a new entry in the Context Expression:

    await this.locator.getByRole("cell", { name: "ContextEntry-1 (<Undefined>)" }).nth(0).hover();
    await this.locator.getByRole("cell", { name: "ContextEntry-1 (<Undefined>)" }).nth(0).locator("svg").click();

Also, consider that in the example above we can change the name of the Context, so the example will not work without changing the ContextEntry-1 to the new name.

This can become very tricky and annoying in more complex scenarios.

The solution:

We need an API to encapsulate the Playwright details and make it easier and clearer to perform tests in BEE.