[docs] add exact matching and element count guidance to E2E docs#14102
Merged
sfc-gh-lwilby merged 1 commit intodevelopfrom Mar 4, 2026
Merged
[docs] add exact matching and element count guidance to E2E docs#14102sfc-gh-lwilby merged 1 commit intodevelopfrom
sfc-gh-lwilby merged 1 commit intodevelopfrom
Conversation
Co-authored-by: Cursor <[email protected]> Co-authored-by: lawilby <[email protected]>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
✅ PR preview is ready!
|
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Streamlit’s E2E Playwright contributor guidance to reduce CI flakiness from ambiguous locators and from stale element-count assertions, and mirrors the same advice across the repo’s documentation/instructions surfaces.
Changes:
- Add guidance to use exact matching to avoid substring-based strict mode violations with
get_by_text. - Add guidance to re-check existing
to_have_count(N)assertions when app scripts gain new elements. - Mirror the same best-practice bullets across the AGENTS doc, GitHub instructions, and Cursor rules.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| e2e_playwright/AGENTS.md | Adds two E2E best-practice bullets (exact matching; update count assertions). |
| .github/instructions/e2e_playwright.instructions.md | Mirrors the same new E2E guidance for GitHub instructions. |
| .cursor/rules/e2e_playwright.mdc | Mirrors the same new E2E guidance for Cursor editor rules. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Adds two best practices to the E2E Playwright testing docs (
AGENTS.mdand mirrors):exact=Truewithget_by_text()andfilter(has_text=...)to prevent substring matching from causing strict mode violations when the target text is a prefix of other text on the page.to_have_count(N)) when adding new elements to an existing app script.Both patterns caused recurring CI failures across the dynamic containers callback PRs.
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.