Skip to content

test(playwright): fix Bots.spec revoke button casing after #37878 - #37938

Merged
harsh-vador merged 1 commit into
mainfrom
fix/bots-spec-revoke-token-case
Nov 17, 2026
Merged

harsh-vador merged 1 commit into
mainfrom
fix/bots-spec-revoke-token-case

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes the Pages/Bots.spec.ts › Bots Page should work properly failure on main (first seen on d9fb134, shard chromium-14, failed on both attempts).

Locator: getByTestId('revoke-button')
Expected substring: "Revoke token"
Received string:    "Revoke Token"
  at createBot (playwright/utils/bot.ts:120)

Root cause: #37878 title-cased label.revoke-token ("Revoke token" → "Revoke Token") in every locale, but createBot in playwright/utils/bot.ts still asserted the old wording with toContainText, which is case-sensitive. Playwright was skipped on #37878, so the first full run after merge is where it surfaced. The product is fine — this is a stale assertion, not a flake.

Fix: assert that the revoke button is visible instead of pinning its label's casing. The step only needs to prove the bot was created with a token; the next assertion already checks the token value in center-panel. The other two strings #37878 re-cased (No {{entity}} Found, View Changes) have no case-sensitive assertions left in playwright/ — the one hit (AccessControlSettings.spec.ts, getByText('No Teams found')) matches case-insensitively.

bots-spec-pass

Type of change:

  • Bug fix

High-level design:

N/A — one-line test fix.

Tests:

Use cases covered

  • Admin creates a bot, sees its JWT token and the revoke button, updates it, searches it by display name / name / email, changes token expiry and deletes it (Bots.spec.ts).

Unit tests

Not applicable — Playwright helper change only.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Files updated: playwright/utils/bot.ts
  • Ran playwright/e2e/Pages/Bots.spec.ts locally against this branch's UI: 1 passed (22.5s) on 0d54a11. Commands: PLAYWRIGHT_IS_OSS=true npx playwright test --project=setup, then npx playwright test playwright/e2e/Pages/Bots.spec.ts --project=Basic --no-deps --retries=0. The UI was this branch served by Vite and proxied to a local 2.1 backend, with the admin in classic app mode (as in CI).

Result (HTML report screenshot):

Visual regression baselines

  • Not applicable (no rendering change).

Manual testing performed

N/A — test-only change; verified by the local Playwright run above.

UI screen recording:

Not applicable — test-only change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — test fix, no issue (skip-pr-checks).
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above — test fix, no issue.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For a UI feature or feature task: … (not applicable — test fix).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    • Reviewed 0d54a11; no 🔴. The assertion stays meaningful: a missing token shows auth-mechanism instead of revoke-button, so toBeVisible() still fails if the bot is created without a token.
  • Decision check: no durable decision.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Updates createBot to check that revoke-button is visible instead of matching its label’s casing.

  • Bot creation checks the revoke button without depending on its label.

Reviews (1) · Last reviewed commit: "test(playwright): assert the bot revoke ..." · Reviewed by Greptile

…sing

#37878 title-cased label.revoke-token to "Revoke Token", but createBot
still asserted the old "Revoke token" with a case-sensitive
toContainText, so Bots.spec failed on every main run since.
@harsh-vador harsh-vador added the skip-pr-checks Bypass PR metadata validation check label Nov 17, 2026
@gitar-bot

gitar-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk

This one-line Playwright assertion change stops pinning button-label casing while retaining visibility and token checks, with no production behavior impact.

Replaces a case-sensitive toContainText('Revoke token') assertion in playwright/utils/bot.ts with a toBeVisible() check on the revoke button, fixing the test broken by the label re-casing in #37878. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador
harsh-vador marked this pull request as ready for review November 17, 2026 05:44
@harsh-vador
harsh-vador requested a review from a team as a code owner November 17, 2026 05:44
@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Nov 17, 2026
@harsh-vador
harsh-vador enabled auto-merge (squash) November 17, 2026 05:53
@harsh-vador
harsh-vador disabled auto-merge November 17, 2026 05:56
@harsh-vador
harsh-vador merged commit 74b337d into main Nov 17, 2026
88 checks passed
@harsh-vador
harsh-vador deleted the fix/bots-spec-revoke-token-case branch November 17, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants