Skip to content

kie-issues#950: Exploratory phase of the strategy for implementing the E2E test suite for the new SceSim editor #2188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 50 commits into from
Apr 11, 2024

Conversation

kbowers-ibm
Copy link
Contributor

@tiagobento tiagobento changed the title kie-issues#950:Exploratory phase of the strategy for implementing the E2E test suite for the new SceSim editor kie-issues#950: Exploratory phase of the strategy for implementing the E2E test suite for the new SceSim editor Mar 1, 2024
Copy link
Contributor

@ljmotta ljmotta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbowers-ibm Thanks for this PR bootstraping the Storybook and Playwright into the new SceSim editor. This is just the start and I could see you put a lot of effort into this work.

I've add a few change requests inline, and also I'd like to address some topics.

Fixtures

You could add some other fixtures to improve the readability of the populate tests. For example:

    await page.getByRole("row", { name: "3" }).getByTestId("monaco-container").first().click();
    await page.getByRole("row", { name: "3" }).getByTestId("monaco-container").first().press("Enter");
    await page.getByLabel("Editor content;Press Alt+F1 for Accessibility Options.").fill('"foo"');

The getByRole("row", { name: "3") could be something like table.getRow({ name: "3" }) or even a getCell({ rowName: "", columnName: "" ) as you are getting the first(). I'm not sure if this is possible, but just an idea. Also the page.getByLabel("Editor content;Press Alt+F1 for Accessibility Options.") doesn't say much, and could have a more meaningful name.

Structure

First, you should use lower case directory names, to follow the monorepo standard. Also, I think we can keep it very simple for now, and remove the deep nested folders, for example: scesimEditor/background/populate, scesimEditor/testScenario/populate. I suggest this as the decision and rule tables doesn't have a structural difference (please correct me if I'm wrong), so we can put the tests into the same file.

Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the testsuite @kbowers-ibm, I put some comments for discussion inline.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values in the table seems to me somehow randomly put in. Is this more check that valid expressions for testing DRL can be put into any cell?

Or put the question differently, does this SCESIM test some DRL (even mocked) file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Jozef,
Thanks for the feedback! Afaik the SceSim editor doesn't have that functionality implemented yet. Once it does I plan on creating tests or changing the populate tests to more meaningful values that will test a DRL/DMN 👍

Comment on lines 37 to 48
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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe here we have a candidate for fixture, lets say cells?

I can imagine then to have API like:

  • cells.rightCell()
  • cells.leftCell()
  • cells.upperCell()
  • cells.bottomCell()
  • maybe all of above with Nth version, cells.nthUpperCell(n) ?
  • cells.active() , cells.editActive()?

I do not know, just idea, sounds like operations we will use very often will cells

Copy link
Contributor

@ljmotta ljmotta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbowers-ibm I think we're almost there. I've made a few comments regarding some name choices and I think some tests need to change a little. Also, I think you forgot to remove the previous dev-webapp.

await this.page.getByRole("menuitem", { name: args.command }).click();
}

public getHeader(args: { header: string }) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is on the right place. The context menu shouldn't have header specific locators.

Copy link
Contributor Author

@kbowers-ibm kbowers-ibm Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed function name/args to clear up any confusion. This is for the assertions when we open the context menu and are confirming which headings exist in the context menu, e.g. field/instance, etc.
public getHeading(args: { heading: HeadingType })

@tiagobento
Copy link
Contributor

@kbowers-ibm You need to merge with main, as some packages have changed the structure.

Copy link
Contributor

@ljmotta ljmotta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbowers-ibm The PR is looking great! Well done. Thanks for your patience. The only missing thing is the pnpm-lock.yaml file. I've added a few steps to ensure it's correct.

I could see a few merge main commits, which steps are you following to perform the merge with main? Are you renaming the default merge commits?

pnpm-lock.yaml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could see a lot of changes on this file... Could you please double check to ensure we have it correct. Delete the file, copy it from main branch, and run pnpm bootstrap. It will correctly update the lock file with the changes from your PR.

Copy link
Contributor Author

@kbowers-ibm kbowers-ibm Apr 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steps I follow to merge with main:
(From local main)
Sync main branch with upstream apache/incubator-kie-tools
git pull
git checkout kie-issues#950
git merge main (if no merge conflicts I will 'git push kbowers-ibm kie-issues#950' and it will automatically have a commit message like "Merge branch 'main' into kie-issues#950")
In this case there were merge conflicts with lock file, so pressed "Accept theirs" for everything. I'm not too familiar with the vscode conflict resolver though, so afterwards I ran:
git checkout main -- /home/kbowers-ibm/projects/kie-tools/pnpm-lock.yaml
pnpm bootstrap

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However now I've done as instructed and just deleted the file from my branch, and copied it from main and ran pnpm bootstrap after

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was still getting errors, so trying again with new commit

@ljmotta
Copy link
Contributor

ljmotta commented Apr 10, 2024

After checking the pnpm-lock.yaml file I could find some inconsistences, please make this steps to ensure everything is correct:

  • Merge with origin/main;
  • Checkout origins pnpm-lock;
  • Update pnpm-lock and push;

On the monorepo root:

git fetch origin
git merge origin/main
git checkout origin/main -- pnpm-lock.yaml
pnpm bootstrap
git add .
git commit
git push ...

@tiagobento tiagobento merged commit b117bfe into apache:main Apr 11, 2024
@kbowers-ibm kbowers-ibm deleted the kie-issues#950 branch April 12, 2024 06:27
fantonangeli pushed a commit to fantonangeli/kie-tools that referenced this pull request Apr 23, 2024
…e E2E test suite for the new SceSim editor (apache#2188)

Co-authored-by: Luiz Motta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Action plan - Exploratory phase of the strategy for implementing the E2E test suite for the new SceSim editor
4 participants