Skip to content

ai: coding standards for e2e tests - #7973

Merged
sid-bruno merged 2 commits into
mainfrom
ai/update-coding-standards-for-e2e
May 11, 2026
Merged

sid-bruno merged 2 commits into
mainfrom
ai/update-coding-standards-for-e2e

Conversation

@sid-bruno

@sid-bruno sid-bruno commented May 11, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • Documentation
    • Updated coding standards with comprehensive E2E testing guidelines for Electron/Playwright: verify user-visible behavior, handle windows/dialogs/prompts via observable outcomes, ensure parallel safety (isolated data, no shared ports/files), remove brittle patterns (hardcoded waits/timeouts, fragile selectors), adopt Arrange/Act/Assert/Cleanup per-test structure, and follow a per-file review checklist for robustness.

Review Change Stack

Copilot AI review requested due to automatic review settings May 11, 2026 10:33
@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds an E2E Tests section to CODING_STANDARDS.md specifying Electron/Playwright E2E guidelines: behavioural assertions, Electron-aware handling, parallel-safe isolation, anti-brittleness rules, per-test Arrange/Act/Assert/Cleanup, and a per-file review checklist.

Changes

E2E Testing Standards

Layer / File(s) Summary
E2E Testing Guidelines
CODING_STANDARDS.md
Adds an Electron E2E/Playwright guideline: require user-visible behaviour assertions, handle Electron windows/dialogs/IPC via observable outcomes, enforce parallel-safe isolation (separate user data, no shared ports/files/DB/cache/global state, deterministic cleanup), ban hardcoded waits/magic timeouts/unsafe selectors/absolute paths/random sleeps in favor of event-driven waits and stable selectors, enforce Arrange/Act/Assert/Cleanup structure per test, and add a per-test-file rewrite/review checklist.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • usebruno/bruno#7140: Related Electron/Playwright E2E test stability changes (replaces platform-specific interaction with cross-platform triple-click).
  • usebruno/bruno#6282: Updates to CODING_STANDARDS.md testing guidance; this PR adds focused Electron/Playwright E2E rules.

Suggested reviewers

  • bijin-bruno
  • lohit-bruno

Poem

🎭 Standards in place, tests run true,
Arrange, Act, Assert — each step in view.
No brittle waits, no random delay,
Electron-aware, running parallel each day.
Playwright sings, stable checks ensue.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding coding standards for E2E tests to the documentation. It is concise, specific, and directly reflects the PR's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ai/update-coding-standards-for-e2e

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
CODING_STANDARDS.md (1)

64-64: ⚡ Quick win

Use platform-neutral path notation in the standards text.

<project-root>/tests/* uses POSIX separators in a cross-platform standards doc. Prefer neutral wording (or tests/**) so the guideline itself doesn’t model hardcoded separators.

Suggested wording update
-When reviewing Electron-specific Playwright tests (<project-root>/tests/*).
+When reviewing Electron-specific Playwright tests in the `tests` directory (e.g., `tests/**`).

As per coding guidelines: “Bruno is a cross-platform Electron desktop app… File paths must use path.join() or path.resolve() instead of hardcoded / or \\ separators.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CODING_STANDARDS.md` at line 64, The guideline text currently uses a
POSIX-style path literal `<project-root>/tests/*`; update that wording to be
platform-neutral (e.g., `tests/**` or "the tests directory") and add a brief
note recommending use of path.join()/path.resolve() for cross-platform paths;
locate the string `<project-root>/tests/*` in CODING_STANDARDS.md and replace it
with the neutral phrasing and the single-sentence reminder about using
path.join/path.resolve.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@CODING_STANDARDS.md`:
- Line 64: The guideline text currently uses a POSIX-style path literal
`<project-root>/tests/*`; update that wording to be platform-neutral (e.g.,
`tests/**` or "the tests directory") and add a brief note recommending use of
path.join()/path.resolve() for cross-platform paths; locate the string
`<project-root>/tests/*` in CODING_STANDARDS.md and replace it with the neutral
phrasing and the single-sentence reminder about using path.join/path.resolve.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b174549c-b98d-4fd9-81b6-7329328db8b2

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad5118 and 229b492.

📒 Files selected for processing (1)
  • CODING_STANDARDS.md

Copilot AI 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.

Pull request overview

Adds an “E2E Tests” section to CODING_STANDARDS.md to guide reviews/rewrites of Electron Playwright end-to-end tests with an emphasis on behavioral assertions, Electron-specific handling, and parallel-safe isolation.

Changes:

  • Introduces review/rewrite guidelines for Electron Playwright E2E tests (behavior-focused, Electron-aware, parallel-safe).
  • Adds a suggested Arrange/Act/Assert/Cleanup test structure and a per-file review checklist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CODING_STANDARDS.md Resolved
Comment thread CODING_STANDARDS.md Resolved
Comment thread CODING_STANDARDS.md Resolved
Comment thread CODING_STANDARDS.md Resolved
@github-actions

github-actions Bot commented May 11, 2026 •

Copy link
Copy Markdown

CLI Test Results

  1 files  ±0  211 suites  ±0   1m 2s ⏱️ -5s
592 tests ±0  592 ✅ ±0  0 💤 ±0  0 ❌ ±0 
705 runs  ±0  698 ✅ ±0  7 💤 ±0  0 ❌ ±0 

Results for commit 02a573a. ± Comparison against base commit 4ad5118.

♻️ This comment has been updated with latest results.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CODING_STANDARDS.md`:
- Line 88: The guideline currently says "Replace hardcoded absolute paths with
temp dirs" but doesn't specify a cross-platform API; update CODING_STANDARDS.md
to explicitly recommend using Node's os.tmpdir() (and path.join for creating
subdirs) or Playwright's temp-dir helpers (e.g., test.info().outputPath /
Playwright temp utilities) instead of hardcoded "/tmp", and add a short example
note to prefer os.tmpdir() for macOS/Windows/Linux compatibility.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6a8e3b1c-822d-4cd1-929d-a3bcca4fd5a5

📥 Commits

Reviewing files that changed from the base of the PR and between 229b492 and 02a573a.

📒 Files selected for processing (1)
  • CODING_STANDARDS.md

Comment thread CODING_STANDARDS.md Resolved
@sid-bruno
sid-bruno merged commit d8fb7c7 into main May 11, 2026
11 checks passed
sharan-bruno pushed a commit to sharan-bruno/bruno that referenced this pull request Jun 4, 2026
* ai: coding standards for e2e tests

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants