Skip to content

feat(tests): Add shiny.pytest, shiny.run and shiny.playwright #1448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 4, 2024

Conversation

karangattu
Copy link
Collaborator

@karangattu karangattu commented Jun 4, 2024

Fixes #1156

While more documentation will be needed, this will be done in a followup PR. If docs are not met, we can cripple the exposed classes / methods then before release.


Public API being exposed:

  • shiny
    • pytest
    • run
      • run_shiny_app() -> ShinyAppProc: Run shiny app process
      • ShinyAppProc: Shiny app process class. Context Manager that calls .close() on __exit__().
    • playwright
      • expect
        • expect_to_change(); Wait until a Locator has updated
        • expect_attribute_to_have_value()
        • expect_to_have_class();
        • expect_not_to_have_class();
        • expect_to_have_style();
      • controls
        • shiny.playwright.controls classes. (Click to expand!)
          • InputActionButton
          • InputActionLink
          • InputCheckbox
          • InputCheckboxGroup
          • InputDarkMode
          • InputDate
          • InputDateRange
          • InputFile
          • InputNumeric
          • InputPassword
          • InputRadioButtons
          • InputSelect
          • InputSelectize
          • InputSlider
          • InputSliderRange
          • InputSwitch
          • InputTaskButton
          • InputText
          • InputTextArea
          • OutputCode
          • OutputDataFrame
          • OutputImage
          • OutputPlot
          • OutputTable
          • OutputText
          • OutputTextVerbatim
          • OutputUi
          • ValueBox
          • Card
          • Accordion
          • Sidebar
          • Popover
          • Tooltip
          • NavItem
          • NavsetBar
          • NavsetCardPill
          • NavsetCardTab
          • NavsetCardUnderline
          • NavsetHidden
          • NavsetPill
          • NavsetPillList
          • NavsetTab
          • NavsetUnderline
          • DownloadButton
          • DownloadLink

Typical typed usage:

from playwright.sync_api import Page

from shiny.playwright.controls import Accordion, InputActionButton, OutputTextVerbatim
from shiny.run import ShinyAppProc

Typical untyped usage:

from shiny.playwright.controls import Accordion, InputActionButton, OutputTextVerbatim

@karangattu karangattu changed the title use shiny.pytest instead of shiny.test feat(tests): Add shiny.pytest, shiny.run and shiny.playwright Jun 4, 2024
@karangattu karangattu requested a review from schloerke June 4, 2024 19:56
@schloerke schloerke enabled auto-merge June 4, 2024 21:26
@schloerke schloerke added the testing Related to testing shiny apps label Jun 4, 2024
@schloerke schloerke added this to the v0.11.0 milestone Jun 4, 2024
@schloerke schloerke added this pull request to the merge queue Jun 4, 2024
Merged via the queue into main with commit 8c48174 Jun 4, 2024
32 checks passed
@schloerke schloerke deleted the refactor-test-modules branch June 4, 2024 21:43
@schloerke
Copy link
Collaborator

Forgot to add a change log entry

schloerke added a commit that referenced this pull request Jun 5, 2024
* epic/df:
  feat(tests): Add shiny.pytest, shiny.run and shiny.playwright (#1448)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Related to testing shiny apps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add testing API for py-shiny
2 participants