Skip to content

Categorising playwright tests into folders - Eagle 1684 - #1075

Merged
M-Wicenec merged 4 commits into
masterfrom
eagle-1684
Oct 5, 2026
Merged

M-Wicenec merged 4 commits into
masterfrom
eagle-1684

Conversation

@M-Wicenec

@M-Wicenec M-Wicenec commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

categorising tests into folders

Summary by Sourcery

Organize and extend the Playwright end-to-end test suite by grouping scenarios by functionality and adding coverage for graph, tutorial, palette, and undo workflows.

Enhancements:

  • Organize Playwright end-to-end tests into feature-specific folders for graphs, palettes, repositories, tutorials, and undo workflows.
  • Expand graph and undo coverage with tests for graph creation and insertion, serialization round trips, validation, parameter editing, tutorial execution, and undo history behavior.
  • Improve test readability by grouping related actions into named Playwright steps.

Tests:

  • Relocate existing end-to-end tests and update helper imports to match their new folder structure.

Chores:

  • Remove obsolete root-level test files and reduce unnecessary tutorial-start logging.

@M-Wicenec
M-Wicenec requested review from james-strauss-uwa and a lite review from Copilot September 22, 2026 08:37
@sourcery-ai

sourcery-ai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR categorizes Playwright end-to-end tests into graph, palette, repository, tutorial, and undo folders, updates imports and test-step structure, adds focused undo/tutorial coverage, removes obsolete root-level copies, and cleans up tutorial logging.

File-Level Changes

Change Details Files
Reorganized end-to-end tests into domain-specific folders and updated helper imports.
  • Moved graph, palette, repository, tutorial, and undo specs into corresponding subdirectories.
  • Adjusted relative imports to the shared TestHelpers module.
  • Preserved test coverage while adding step grouping to several relocated tests.
e2e/graph/cloneLogicalGraph.spec.ts
e2e/graph/creatingASimpleGraph.spec.ts
e2e/graph/findEdgesContainedByNodes.spec.ts
e2e/graph/insertGraph.spec.ts
e2e/graph/loadSaveJsonMatch.spec.ts
e2e/graph/parameterTableAndKeyboardShortcuts.spec.ts
e2e/graph/v4FormatJsonMatch.spec.ts
e2e/graph/validatingGraphs.spec.ts
e2e/palettes/addGraphNodesToPalette.spec.ts
e2e/palettes/creatingAndEditingPalettes.spec.ts
e2e/repositories/addingAndRemovingRepositories.spec.ts
e2e/tutorials/tutorials.spec.ts
e2e/undo/undoAfterFixAll.spec.ts
e2e/undo/undoBoundary.spec.ts
e2e/undo/undoDuplicateDetection.spec.ts
e2e/undo/undoRedo.spec.ts
Expanded and refined end-to-end test organization and execution structure.
  • Added explicit test steps for setup, actions, and verification in relocated scenarios.
  • Changed tutorial coverage to discover registered tutorials and run each from a fresh application state.
  • Added regression coverage for undo boundaries, duplicate snapshots, and preserving fixes after undo.
e2e/tutorials/tutorials.spec.ts
e2e/undo/undoAfterFixAll.spec.ts
e2e/undo/undoBoundary.spec.ts
e2e/undo/undoDuplicateDetection.spec.ts
e2e/undo/undoRedo.spec.ts
e2e/palettes/creatingAndEditingPalettes.spec.ts
Removed obsolete root-level test files and eliminated tutorial-start logging.
  • Deleted the original ungrouped copies after relocating their tests.
  • Removed the console log emitted when starting tutorials.
e2e/TestHelpers.ts
e2e/addGraphNodesToPalette.spec.ts
e2e/creatingASimpleGraph.spec.ts
e2e/example.spec.ts
e2e/insertGraph.spec.ts
e2e/loadSaveJsonMatch.spec.ts
e2e/parameterTableAndKeyboardShortcuts.spec.ts
e2e/tutorials.spec.ts
e2e/undoAfterFixAll.spec.ts
e2e/undoBoundary.spec.ts
e2e/undoDuplicateDetection.spec.ts
e2e/undoRedo.spec.ts
e2e/v4FormatJsonMatch.spec.ts
e2e/validatingGraphs.spec.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="e2e/undo/undoAfterFixAll.spec.ts" line_range="37" />
<code_context>
+        await page.locator('div[data-notify="container"]').waitFor({ state: 'attached' });
+        await page.locator('button[data-notify="dismiss"]').click();
+        await page.locator('div[data-notify="container"]').waitFor({ state: 'detached' });
+        await expect.poll(async () => await TestHelpers.getNumWarningsErrors(page)).toBeLessThanOrEqual(initialCount);
+        postFixCount = await TestHelpers.getNumWarningsErrors(page);
+        console.log('Post-fix warnings+errors:', postFixCount);
+    });
</code_context>
<issue_to_address>
**issue (testing):** The assertion only requires the post-fix issue count to be less than or equal to the initial count, so the test passes when pressing `f` does nothing and no issues are fixed. The later undo assertion then verifies a state that was never confirmed to be produced by `fixAll`.

**Triggers:** When the fix-all keyboard shortcut is broken or does not apply any fixes.

**Suggested fix:** Assert that the fix operation changes the issue state, for example by requiring `postFixCount` to be strictly less than `initialCount` when this fixture is expected to contain fixable issues.

```suggestion
        await expect.poll(async () => await TestHelpers.getNumWarningsErrors(page)).toBeLessThan(initialCount);
```
</issue_to_address>

### Comment 2
<location path="e2e/graph/validatingGraphs.spec.ts" line_range="18-22" />
<code_context>
+test('Validating Graphs', async ({ page }) => {
+  for (const graphUrl of GRAPHS){
+    await test.step(`Validate graph: ${graphUrl}`, async () => {
+      await page.goto('http://localhost:8888/?tutorial=none&service=Url&url='+graphUrl);
+      await TestHelpers.waitForNotificationAndDismiss(page);
+      await TestHelpers.openGraphMenuAndSelect(page, 'validateGraph');
+      await page.locator('div[data-notify="container"]').waitFor({state: 'attached'});
+      await expect(page.locator('span[data-notify="message"]')).toContainText(" valid ");
+    });
+  }
</code_context>
<issue_to_address>
**issue (testing):** The validation notification is never dismissed before the loop proceeds to the next graph. On the next iteration, `waitForNotificationAndDismiss` can dismiss the previous graph's validation result instead of waiting for the new graph-load notification, allowing validation to run against stale or incompletely loaded graph state.

**Triggers:** When the validation notification remains attached while the next graph is loaded.

**Suggested fix:** Dismiss and wait for detachment of the validation result at the end of each iteration, and explicitly wait for the next graph-load notification before opening the validation menu.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: e2e/undo/undoAfterFixAll.spec.ts:37, e2e/graph/validatingGraphs.spec.ts:22


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread e2e/undo/undoAfterFixAll.spec.ts Outdated
Comment thread e2e/graph/validatingGraphs.spec.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Three relocated graph specs still resolve a fixture from the old directory and fail before page load.

Review effort: Lite
Findings: None

What changed in this PR

Reorganizes the Playwright E2E suite by domain and expands workflow and regression coverage.

Changes:

  • Groups graph, palette, repository, tutorial, and undo tests.
  • Updates helper imports and adds structured test steps.
  • Removes obsolete root-level specs and tutorial logging.
File Summary
e2e/​validatingGraphs.spec.ts Removed after relocation.
e2e/​v4FormatJsonMatch.spec.ts Removed after relocation.
e2e/​undoDuplicateDetection.spec.ts Removed after relocation.
e2e/​undoBoundary.spec.ts Removed after relocation.
e2e/​undoAfterFixAll.spec.ts Removed after relocation.
e2e/​undo/​undoRedo.spec.ts Updated imports and test steps.
e2e/​undo/​undoDuplicateDetection.spec.ts Added categorized undo regression coverage.
e2e/​undo/​undoBoundary.spec.ts Added undo-boundary coverage.
e2e/​undo/​undoAfterFixAll.spec.ts Added fix-and-undo regression coverage.
e2e/​tutorials/​tutorials.spec.ts Added categorized tutorial coverage.
e2e/​tutorials.spec.ts Removed after relocation.
e2e/​TestHelpers.ts Removed tutorial-start logging.
e2e/​repositories/​addingAndRemovingRepositories.spec.ts Updated helper import.
e2e/​parameterTableAndKeyboardShortcuts.spec.ts Removed after relocation.
e2e/​palettes/​creatingAndEditingPalettes.spec.ts Updated imports and step structure.
e2e/​palettes/​addGraphNodesToPalette.spec.ts Added categorized palette coverage.
e2e/​loadSaveJsonMatch.spec.ts Removed after relocation.
e2e/​insertGraph.spec.ts Removed after relocation.
e2e/​graph/​validatingGraphs.spec.ts Added categorized graph validation coverage.
e2e/​graph/​v4FormatJsonMatch.spec.ts Added format round-trip coverage; fixture path needs correction.
e2e/​graph/​parameterTableAndKeyboardShortcuts.spec.ts Added categorized parameter coverage.
e2e/​graph/​loadSaveJsonMatch.spec.ts Added JSON round-trip coverage; fixture path needs correction.
e2e/​graph/​insertGraph.spec.ts Added graph insertion coverage; fixture path needs correction.
e2e/​graph/​findEdgesContainedByNodes.spec.ts Updated helper import.
e2e/​graph/​creatingASimpleGraph.spec.ts Added categorized graph creation coverage.
e2e/​graph/​cloneLogicalGraph.spec.ts Updated helper import.
e2e/​example.spec.ts Removed obsolete sample tests.
e2e/​creatingASimpleGraph.spec.ts Removed after relocation.
e2e/​addGraphNodesToPalette.spec.ts Removed after relocation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@M-Wicenec M-Wicenec changed the title Eagle 1684 Categorising playwright tests into folders - Eagle 1684 Sep 24, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@M-Wicenec

Copy link
Copy Markdown
Collaborator Author

@james-strauss-uwa ready for your review.

@james-strauss-uwa

Copy link
Copy Markdown
Collaborator

@copilot review

@james-strauss-uwa james-strauss-uwa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice improvement

@M-Wicenec
M-Wicenec merged commit 6e6b9fc into master Oct 5, 2026
5 checks passed
@M-Wicenec
M-Wicenec deleted the eagle-1684 branch October 5, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants