posit-dev / py-shiny

Shiny for Python
https://shiny.posit.co/py/
MIT License
1.24k stars 70 forks source link

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

Closed karangattu closed 3 months ago

karangattu commented 3 months ago

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

schloerke commented 3 months ago

A: It was not in v0.10.

If it was not exposed in v0.10:

Both:

schloerke commented 3 months ago

@karangattu Ready to merge when you are