Skip to content

Better debug nuxt common bump#169

Merged
zendern merged 3 commits into
mainfrom
better-debug-nuxt-common-bump
May 22, 2026
Merged

Better debug nuxt common bump#169
zendern merged 3 commits into
mainfrom
better-debug-nuxt-common-bump

Conversation

@zendern
Copy link
Copy Markdown
Contributor

@zendern zendern commented May 22, 2026

Link to Issue or Message thread

Related to this https://github.com/lab-sync/copier-circuit-python-device-driver-frontend/pull/3

Why is this change necessary?

Need to have latest nuxt-common version downstream to fix issues with e2e tests.

How does this change address the issue?

While trying to figure out issues with e2e tests had to do some debugging. Backporting that into the template. Now it'll console log anything that the app logs to console or if there are page/request errors. And if the test fails it will take a screenshot and save it.

What side effects does this change have?

N/A

How is this change tested?

Downstream

Summary by CodeRabbit

  • Chores

    • Updated a dependency to version 0.1.1
  • Tests

    • Enhanced E2E test suite with automatic screenshot capture on test failures and improved logging for browser output and network issues

Review Change Stack

@zendern zendern requested a review from ejfine May 22, 2026 18:36
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

This PR enhances E2E test failure diagnostics by adding screenshot capture on test failure. It updates a shared library version, implements Playwright page event listeners and Vitest failure hooks to capture full-page screenshots and browser output when tests fail, and updates .gitignore to exclude the generated screenshots directory.

Changes

E2E Test Failure Diagnostics

Layer / File(s) Summary
Shared library version update
extensions/context.py
The generated context template value labsync_nuxt_common_version is bumped from ^0.1.0 to ^0.1.1.
E2E test failure diagnostics
template/frontend/tests/setup/app.ts
Node fs and path imports are added alongside Vitest onTestFailed hook. Playwright page event listeners for console, page errors, and failed requests are registered. A test failure hook creates a ./test-screenshots directory (if needed), sanitizes the test name, captures a full-page screenshot, and logs the saved PNG path.
Exclude generated test artifacts
template/.gitignore
The test-screenshots directory is added to .gitignore to exclude test-generated screenshots from version control.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ejfine
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Better debug nuxt common bump' is vague and unclear—it doesn't precisely convey that the PR updates the nuxt-common version dependency and adds e2e test debugging features. Consider a more specific title like 'Add e2e debugging and update nuxt-common version' or 'Bump nuxt-common and enhance test failure diagnostics'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description follows the provided template structure and includes all required sections with substantive content addressing the change rationale, implementation approach, and testing method.
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.


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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 `@template/frontend/tests/setup/app.ts`:
- Around line 31-33: The screenshot file name uses only ctx.task.name (safeName)
which can collide; modify the screenshotPath creation used before
page.screenshot to append a unique suffix (for example ctx.task.id or a
timestamp/UUID) to safeName so filenames are unique; update the code that builds
screenshotPath (the variables safeName and screenshotPath and the
page.screenshot call) to include that unique suffix when generating the
`${safeName}.png` filename.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 9fcbb419-25e5-4af6-9064-36f06721228f

📥 Commits

Reviewing files that changed from the base of the PR and between 9239f3f and 2e5a923.

📒 Files selected for processing (3)
  • extensions/context.py
  • template/.gitignore
  • template/frontend/tests/setup/app.ts

Comment thread template/frontend/tests/setup/app.ts
@zendern zendern merged commit 8cf41cb into main May 22, 2026
35 checks passed
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.

2 participants