Skip to content
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

tests(controls): Change API from controls to controller #1481

Merged
merged 5 commits into from
Jun 25, 2024

Conversation

karangattu
Copy link
Collaborator

@karangattu karangattu commented Jun 25, 2024

Fixes #1450

We wanted to make sure the test templates can be run by the user instead of an error.
So we want to users to import controller as shown below

from shiny.playwright import controller

def test_app(page, local_app):
    # Set up controllers here
    btn = controller.InputButton(page, "btn")`
    ....

This is a change from the current implementation

from shiny.playwright.controls import InputButton
def test_app(page, local_app):
    # Set up controllers here
    btn = InputButton(page, "btn")`
    ....

This change modifies all playwright tests in line with this API change

Copy link
Collaborator

@schloerke schloerke left a comment

Choose a reason for hiding this comment

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

Q: Was shiny playwright testing exposed in v0.10?

If it was exposed in v0.10:

  • We need a deprecation entry in the changelog.
  • We also need a file at shiny.playwright.controls that if loaded will display a deprecation warning.
  • This file should reexport all of the controllers objects.

@schloerke
Copy link
Collaborator

schloerke commented Jun 25, 2024

A: It was not in v0.10.

If it was not exposed in v0.10:

  • Move the changelog entry up from the v0.10 to latest changes.
  • Expand a little upon what is in shiny.playwright

Both:

  • Add changelog entry for shiny add test

@schloerke
Copy link
Collaborator

@karangattu Ready to merge when you are

@schloerke schloerke added the testing Related to testing shiny apps label Jun 25, 2024
@karangattu karangattu marked this pull request as ready for review June 25, 2024 15:46
@karangattu karangattu added this pull request to the merge queue Jun 25, 2024
Merged via the queue into main with commit 0155127 Jun 25, 2024
31 checks passed
@karangattu karangattu deleted the rename-controls-to-controller branch June 25, 2024 15:59
schloerke added a commit that referenced this pull request Jun 25, 2024
* main:
  tests(controls): Change API from controls to controller (#1481)
  fix(docs): Update path to reflect correct one (#1478)
  docs(testing): Add quarto page for testing (#1461)
  fix(test): Remove unused testrail reporting from nightly builds (#1476)
  chore(pyright): Remove version restriction and fix appropriate pyright errors (#1473)
schloerke added a commit to machow/py-shiny that referenced this pull request Jul 2, 2024
* main:
  fix(tests): dynamically determine the path to the shiny app (posit-dev#1485)
  tests(deploys): use a stable version of html tools instead of main branch (posit-dev#1483)
  feat(data frame): Support basic cell styling (posit-dev#1475)
  fix: support static files on pyodide / py.cafe under a prefix (posit-dev#1486)
  feat: Dynamic theming (posit-dev#1358)
  Add return type for `_task()` (posit-dev#1484)
  tests(controls): Change API from controls to controller (posit-dev#1481)
  fix(docs): Update path to reflect correct one (posit-dev#1478)
  docs(testing): Add quarto page for testing (posit-dev#1461)
  fix(test): Remove unused testrail reporting from nightly builds (posit-dev#1476)
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 a change log entry for testing api
2 participants