Skip to content

Conversation

@sfc-gh-lwilby
Copy link
Collaborator

@sfc-gh-lwilby sfc-gh-lwilby commented Nov 18, 2025

Describe your changes

We have two helpers get_caption (new) and get_markdown that replace the index based access in the st_markdown_test.

GitHub Issue Link (if applicable)

Testing Plan

Test only.


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Contributor

snyk-io bot commented Nov 18, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13035/streamlit-1.51.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13035.streamlit.app (☁️ Deploy here if not accessible)

@sfc-gh-lwilby sfc-gh-lwilby added security-assessment-completed Security assessment has been completed for PR impact:internal PR changes only affect internal code change:refactor PR contains code refactoring without behavior change labels Nov 18, 2025
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch from 12a03ee to 592b7d3 Compare November 18, 2025 04:20
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 0676383 to 06a7ab5 Compare November 18, 2025 04:20
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch from 592b7d3 to f0d2c9d Compare November 18, 2025 04:28
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 06a7ab5 to 48076e4 Compare November 18, 2025 04:28
@sfc-gh-lwilby sfc-gh-lwilby changed the base branch from 11-17-text-alignment-heading-elements to graphite-base/13035 November 18, 2025 05:26
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 48076e4 to 8ba3394 Compare November 18, 2025 05:27
@sfc-gh-lwilby sfc-gh-lwilby changed the base branch from graphite-base/13035 to 11-17-text-alignment-heading-elements November 18, 2025 05:27
@sfc-gh-lwilby sfc-gh-lwilby changed the base branch from 11-17-text-alignment-heading-elements to graphite-base/13035 November 18, 2025 05:55
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 8ba3394 to 990df6b Compare November 18, 2025 05:56
@sfc-gh-lwilby sfc-gh-lwilby changed the base branch from graphite-base/13035 to 11-17-text-alignment-heading-elements November 18, 2025 05:56
@sfc-gh-lwilby sfc-gh-lwilby changed the title text-alignment-st-markdown-test-refactor-get-caption-helper [refactor][TextAlignment] Adds get_caption helper for tests and updates st_markdown_test to new pattern Nov 18, 2025
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 990df6b to 23623d2 Compare November 18, 2025 15:40
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch 2 times, most recently from 2e3c2d1 to 9386492 Compare November 18, 2025 15:57
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 23623d2 to 263f50d Compare November 18, 2025 15:58
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch from 9386492 to e771f02 Compare November 19, 2025 03:58
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 57b0305 to 8022a6f Compare November 19, 2025 22:54
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch 2 times, most recently from 647c794 to ffcbe27 Compare November 20, 2025 00:07
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch 2 times, most recently from 2c306e3 to f4977c3 Compare November 20, 2025 00:11
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch from ffcbe27 to a54a40d Compare November 20, 2025 00:11
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from f4977c3 to 3b295db Compare November 20, 2025 00:13
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch from a54a40d to 1d5abcb Compare November 20, 2025 00:13
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 3b295db to c0dfe77 Compare November 20, 2025 03:58
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch from 1d5abcb to cdf6a3d Compare November 20, 2025 03:58
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch 2 times, most recently from 2aaa0c7 to c88a5dd Compare November 20, 2025 04:45
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-heading-elements branch from cdf6a3d to 274d56c Compare November 20, 2025 04:46
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch 2 times, most recently from 14da0bf to 72c5f0f Compare November 20, 2025 06:31
@sfc-gh-lwilby sfc-gh-lwilby force-pushed the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch from 72c5f0f to d6f02ce Compare November 20, 2025 07:19
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are larger because I removed the expanders.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are no longer rendered in expanders.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of snapshot updates because the div that is being captured has changed.

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the st_markdown_test.py E2E test to follow best practices by using label-based locators instead of index-based element access. It introduces a new get_caption helper function and updates the test app structure by removing expander-based organization.

Key Changes:

  • Added get_caption() helper function in app_utils.py for better test element targeting
  • Refactored width example tests to use get_markdown() and get_caption() with text-based filtering
  • Simplified test app by removing expander wrapping, making elements directly accessible

Reviewed Changes

Copilot reviewed 3 out of 69 changed files in this pull request and generated no comments.

File Description
e2e_playwright/shared/app_utils.py Adds new get_caption() helper function that locates caption elements by text content using stCaptionContainer test ID
e2e_playwright/st_markdown_test.py Refactors tests to use get_markdown() and get_caption() helpers with regex patterns instead of .nth() index-based access; removes dependency on expander organization
e2e_playwright/st_markdown.py Removes expander wrappers from width examples, flattening the test app structure for direct element access
e2e_playwright/__snapshots__/**/*.png Updated screenshot snapshots reflecting removal of expanders from the test app UI

Base automatically changed from 11-17-text-alignment-heading-elements to develop November 21, 2025 04:16
@sfc-gh-lwilby sfc-gh-lwilby merged commit 0c5ea94 into develop Nov 21, 2025
43 checks passed
@sfc-gh-lwilby sfc-gh-lwilby deleted the 11-17-text-alignment-st-markdown-test-refactor-get-caption-helper branch November 21, 2025 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:refactor PR contains code refactoring without behavior change impact:internal PR changes only affect internal code security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants