-
Notifications
You must be signed in to change notification settings - Fork 221
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
Conversation
… E2E test suite for the new SceSim editor
There was a problem hiding this 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.
packages/scesim-editor/tests/e2e/scesimEditor/Decision/Background/populate.spec.ts
Outdated
Show resolved
Hide resolved
packages/scesim-editor/tests/e2e/scesimEditor/Decision/Background/populate.spec.ts
Outdated
Show resolved
Hide resolved
packages/scesim-editor/tests/e2e/scesimEditor/Decision/TestScenario/populate.spec.ts
Outdated
Show resolved
Hide resolved
packages/scesim-editor/tests/e2e/scesimEditor/Rule/Background/populate.spec.ts
Outdated
Show resolved
Hide resolved
packages/scesim-editor/tests/e2e/scesimEditor/Rule/TestScenario/populate.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 👍
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"); |
There was a problem hiding this comment.
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
There was a problem hiding this 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
.
packages/scesim-editor/tests/e2e/__fixtures__/backgroundTable.ts
Outdated
Show resolved
Hide resolved
await this.page.getByRole("menuitem", { name: args.command }).click(); | ||
} | ||
|
||
public getHeader(args: { header: string }) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 })
packages/scesim-editor/tests/e2e/__fixtures__/testScenarioTable.ts
Outdated
Show resolved
Hide resolved
packages/scesim-editor/tests/e2e/scesimEditor/backgroundTable/contextMenu.spec.ts
Outdated
Show resolved
Hide resolved
packages/scesim-editor/tests/e2e/features/selection/contextMenu.spec.ts
Outdated
Show resolved
Hide resolved
packages/scesim-editor/tests/e2e/scesimEditor/testScenarioTable/contextMenu.spec.ts
Outdated
Show resolved
Hide resolved
@kbowers-ibm You need to merge with |
There was a problem hiding this 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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
After checking the
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 ... |
…e E2E test suite for the new SceSim editor (apache#2188) Co-authored-by: Luiz Motta <[email protected]>
Closes apache/incubator-kie-issues#950