Skip to content

test(core-components): consolidate prompt template regression spec - #210

Merged
Victor-w-Madeira merged 4 commits into
mainfrom
feature/issue-185-prompt-template-component-regression
May 11, 2026
Merged

test(core-components): consolidate prompt template regression spec#210
Victor-w-Madeira merged 4 commits into
mainfrom
feature/issue-185-prompt-template-component-regression

Conversation

@Victor-w-Madeira

Copy link
Copy Markdown
Collaborator

Summary

  • Add core-components/prompt-template-component-regression.spec.ts with 6 @stable @release @regression @components tests (canvas render, dynamic handles from {var}, variable removal, variable replacement, full clear, and modal persistence — the last being new for this issue).
  • Move the 5 pre-existing prompt tests from ui-ux/prompt-dynamic-variables.spec.ts and ui-ux/prompt-remove-variable.spec.ts into the new consolidated spec; delete the old files.
  • Add docs/core-components/prompt-template-component-regression.md with all mandatory sections.
  • Flip QA-CHECKLIST §3.2 bullets from [-] to [x] and update QA-SCENARIOS-GUIDE.md to point at the new path.

Closes #185

Test plan

  • npm run typecheck — clean
  • npm run lint — clean (one non-blocking waitForTimeout warning, load-bearing for canvas re-render after handle add/remove; matches pattern in webhook/api-request specs)
  • npx playwright test tests/tests-automations/regression/core-components/prompt-template-component-regression.spec.ts — 6/6 pass in 36.7s with no backend errors

Move 5 prompt-template tests from ui-ux/ to core-components/, add a new
modal-persistence test, and surface coverage in QA-CHECKLIST §3.2.
- Drop waitForTimeout(1500) from setPromptTemplate; anchor modal close on
  textarea testid disappearance and rely on auto-retried handle assertions
- Replace [role="dialog"] with modal-promptarea_prompt_template testid
- Add backend persistence assertion to test 6 — poll
  GET /api/v1/flows/{id} until template.template.value matches the saved
  string. Uses page.request to inherit session cookies
- Uniformize handle counting via dynamicHandlesLocator helper filtering
  only left-side input handles
- Flip QA-SCENARIOS-GUIDE.md §10.1 and §10.2 markers from [-] to [x]

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

Consolidates Prompt Template E2E regression coverage into a single core-components/ Playwright spec with @stable @release @regression @components tagging, and updates QA documentation/checklists to reference the new canonical test location.

Changes:

  • Added prompt-template-component-regression.spec.ts containing 6 Prompt Template regression tests (including a new modal + backend persistence check) and removed the two older ui-ux/ prompt specs.
  • Updated QA-CHECKLIST.md and QA-SCENARIOS-GUIDE.md to point at the consolidated spec and mark Prompt Template items as validated ([x]).
  • Added docs/core-components/prompt-template-component-regression.md documenting intent, steps, dependencies, and validation criteria.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/tests-automations/regression/ui-ux/prompt-remove-variable.spec.ts Deleted; tests migrated into consolidated core-components spec.
tests/tests-automations/regression/ui-ux/prompt-dynamic-variables.spec.ts Deleted; tests migrated into consolidated core-components spec.
tests/tests-automations/regression/core-components/prompt-template-component-regression.spec.ts New consolidated @stable regression spec for Prompt Template (6 scenarios).
QA-SCENARIOS-GUIDE.md Updated Prompt Template section to reference the new spec path and mark scenarios as validated.
QA-CHECKLIST.md Marked Prompt Template checklist bullets as validated and linked them to the new spec.
docs/core-components/prompt-template-component-regression.md New regression spec documentation for Prompt Template.

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

Comment on lines +51 to +53
- Records the initial count of `handle-prompt template` testids.
- Calls `setPromptTemplate` with `Hello {name}, your job is {profession}.`.
- Asserts the new handle count is strictly greater than the initial count.
Comment on lines +57 to +60
- Sets the template to `Hello {name}!` and asserts the `name` handle is visible.
- Records the current handle count.
- Sets the template to `Hello world!` and asserts the `name` handle has zero matches.
- Asserts the new handle count is strictly less than the recorded count.
- Drop "records initial count / asserts increase" wording from tests 2, 3,
  and 5 — the spec now asserts exact dynamic-handle counts via the
  dynamicHandlesLocator and the specific per-variable handles, not
  before/after comparisons (the count comparison was removed when
  waitForTimeout was dropped from the helper).
- Fix External dependencies: api_utils.py lives under src/lfx/, the
  extractor uses Python's string.Formatter (not a regex), and the
  PromptComponent path now points at the real prompt.py location.
CONTRIBUTING.md requires every test to have test.step() describing
each block. The spec was previously flat; this commit groups setup,
action, and assertion phases into named steps so traces are readable
and failures point at the right phase.

Validation performed (per CONTRIBUTING.md):
- npx playwright test --trace=on --reporter=html: 6/6 pass, traces
  generated for every test
- Force-fail per test: each test fails when its main assertion is
  inverted (no false positives)
- Clean re-run: 6/6 pass in ~27s, zero backend errors
@Victor-w-Madeira
Victor-w-Madeira merged commit 1420d46 into main May 11, 2026
2 checks passed
@Victor-w-Madeira
Victor-w-Madeira deleted the feature/issue-185-prompt-template-component-regression branch May 11, 2026 20:08
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.

test(core-components): create prompt-template-component-regression spec

2 participants