From 5a69206a161ab22a683ddec4dfb039a9535f8a11 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 26 Jul 2024 09:53:57 -0400 Subject: [PATCH 1/2] Skip all chat tests on webkit. No clue why they are not working --- .../chat/append_user_msg/test_chat_append_user_msg.py | 2 ++ .../shiny/components/chat/basic/test_chat_basic.py | 2 ++ .../shiny/components/chat/errors/test_chat_errors.py | 2 ++ .../shiny/components/chat/stream/test_chat_stream.py | 2 ++ .../shiny/components/chat/transform/test_chat_transform.py | 2 ++ .../transform_assistant/test_chat_transform_assistant.py | 2 ++ tests/playwright/utils/deploy_utils.py | 6 ++++++ 7 files changed, 18 insertions(+) diff --git a/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py b/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py index c42c5a214..93385ada6 100644 --- a/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py +++ b/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py @@ -2,8 +2,10 @@ from shiny.playwright import controller from shiny.run import ShinyAppProc +from tests.playwright.utils.deploy_utils import skip_on_webkit +@skip_on_webkit def test_validate_chat_append_user_message(page: Page, local_app: ShinyAppProc) -> None: page.goto(local_app.url) diff --git a/tests/playwright/shiny/components/chat/basic/test_chat_basic.py b/tests/playwright/shiny/components/chat/basic/test_chat_basic.py index 82e1bcf42..ef868dc8a 100644 --- a/tests/playwright/shiny/components/chat/basic/test_chat_basic.py +++ b/tests/playwright/shiny/components/chat/basic/test_chat_basic.py @@ -2,8 +2,10 @@ from shiny.playwright import controller from shiny.run import ShinyAppProc +from tests.playwright.utils.deploy_utils import skip_on_webkit +@skip_on_webkit def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None: page.goto(local_app.url) diff --git a/tests/playwright/shiny/components/chat/errors/test_chat_errors.py b/tests/playwright/shiny/components/chat/errors/test_chat_errors.py index c38bbd5c4..c1051c246 100644 --- a/tests/playwright/shiny/components/chat/errors/test_chat_errors.py +++ b/tests/playwright/shiny/components/chat/errors/test_chat_errors.py @@ -2,8 +2,10 @@ from shiny.playwright import controller from shiny.run import ShinyAppProc +from tests.playwright.utils.deploy_utils import skip_on_webkit +@skip_on_webkit def test_validate_chat_basic_error(page: Page, local_app: ShinyAppProc) -> None: page.goto(local_app.url) diff --git a/tests/playwright/shiny/components/chat/stream/test_chat_stream.py b/tests/playwright/shiny/components/chat/stream/test_chat_stream.py index 04889b7ce..16e11b591 100644 --- a/tests/playwright/shiny/components/chat/stream/test_chat_stream.py +++ b/tests/playwright/shiny/components/chat/stream/test_chat_stream.py @@ -4,8 +4,10 @@ from shiny.playwright import controller from shiny.run import ShinyAppProc +from tests.playwright.utils.deploy_utils import skip_on_webkit +@skip_on_webkit def test_validate_chat(page: Page, local_app: ShinyAppProc) -> None: page.goto(local_app.url) diff --git a/tests/playwright/shiny/components/chat/transform/test_chat_transform.py b/tests/playwright/shiny/components/chat/transform/test_chat_transform.py index 4b06be4e9..651ae86bc 100644 --- a/tests/playwright/shiny/components/chat/transform/test_chat_transform.py +++ b/tests/playwright/shiny/components/chat/transform/test_chat_transform.py @@ -2,8 +2,10 @@ from shiny.playwright import controller from shiny.run import ShinyAppProc +from tests.playwright.utils.deploy_utils import skip_on_webkit +@skip_on_webkit def test_validate_chat_transform(page: Page, local_app: ShinyAppProc) -> None: page.goto(local_app.url) diff --git a/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py b/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py index 7246a08e3..3cf6ab035 100644 --- a/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py +++ b/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py @@ -3,8 +3,10 @@ from shiny import ui from shiny.playwright import controller from shiny.run import ShinyAppProc +from tests.playwright.utils.deploy_utils import skip_on_webkit +@skip_on_webkit def test_validate_chat_transform_assistant(page: Page, local_app: ShinyAppProc) -> None: page.goto(local_app.url) diff --git a/tests/playwright/utils/deploy_utils.py b/tests/playwright/utils/deploy_utils.py index 38f40b1a3..95f7798ee 100644 --- a/tests/playwright/utils/deploy_utils.py +++ b/tests/playwright/utils/deploy_utils.py @@ -52,6 +52,12 @@ def skip_if_not_chrome(fn: CallableT) -> CallableT: return fn +def skip_on_webkit(fn: CallableT) -> CallableT: + fn = pytest.mark.skip_browser("webkit")(fn) + + return fn + + def run_command(cmd: str) -> str: output = subprocess.run( cmd, From 5521ed94b76a74b8ee628fb39d3d0099f23d22ed Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 26 Jul 2024 10:02:42 -0400 Subject: [PATCH 2/2] Update import location --- .../chat/append_user_msg/test_chat_append_user_msg.py | 2 +- tests/playwright/shiny/components/chat/basic/test_chat_basic.py | 2 +- .../playwright/shiny/components/chat/errors/test_chat_errors.py | 2 +- .../playwright/shiny/components/chat/stream/test_chat_stream.py | 2 +- .../shiny/components/chat/transform/test_chat_transform.py | 2 +- .../chat/transform_assistant/test_chat_transform_assistant.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py b/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py index 93385ada6..87debcd3b 100644 --- a/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py +++ b/tests/playwright/shiny/components/chat/append_user_msg/test_chat_append_user_msg.py @@ -1,8 +1,8 @@ from playwright.sync_api import Page, expect +from utils.deploy_utils import skip_on_webkit from shiny.playwright import controller from shiny.run import ShinyAppProc -from tests.playwright.utils.deploy_utils import skip_on_webkit @skip_on_webkit diff --git a/tests/playwright/shiny/components/chat/basic/test_chat_basic.py b/tests/playwright/shiny/components/chat/basic/test_chat_basic.py index ef868dc8a..12b212320 100644 --- a/tests/playwright/shiny/components/chat/basic/test_chat_basic.py +++ b/tests/playwright/shiny/components/chat/basic/test_chat_basic.py @@ -1,8 +1,8 @@ from playwright.sync_api import Page, expect +from utils.deploy_utils import skip_on_webkit from shiny.playwright import controller from shiny.run import ShinyAppProc -from tests.playwright.utils.deploy_utils import skip_on_webkit @skip_on_webkit diff --git a/tests/playwright/shiny/components/chat/errors/test_chat_errors.py b/tests/playwright/shiny/components/chat/errors/test_chat_errors.py index c1051c246..e238c5b4b 100644 --- a/tests/playwright/shiny/components/chat/errors/test_chat_errors.py +++ b/tests/playwright/shiny/components/chat/errors/test_chat_errors.py @@ -1,8 +1,8 @@ from playwright.sync_api import Page, expect +from utils.deploy_utils import skip_on_webkit from shiny.playwright import controller from shiny.run import ShinyAppProc -from tests.playwright.utils.deploy_utils import skip_on_webkit @skip_on_webkit diff --git a/tests/playwright/shiny/components/chat/stream/test_chat_stream.py b/tests/playwright/shiny/components/chat/stream/test_chat_stream.py index 16e11b591..4c69e3e4d 100644 --- a/tests/playwright/shiny/components/chat/stream/test_chat_stream.py +++ b/tests/playwright/shiny/components/chat/stream/test_chat_stream.py @@ -1,10 +1,10 @@ import re from playwright.sync_api import Page, expect +from utils.deploy_utils import skip_on_webkit from shiny.playwright import controller from shiny.run import ShinyAppProc -from tests.playwright.utils.deploy_utils import skip_on_webkit @skip_on_webkit diff --git a/tests/playwright/shiny/components/chat/transform/test_chat_transform.py b/tests/playwright/shiny/components/chat/transform/test_chat_transform.py index 651ae86bc..7209407f8 100644 --- a/tests/playwright/shiny/components/chat/transform/test_chat_transform.py +++ b/tests/playwright/shiny/components/chat/transform/test_chat_transform.py @@ -1,8 +1,8 @@ from playwright.sync_api import Page, expect +from utils.deploy_utils import skip_on_webkit from shiny.playwright import controller from shiny.run import ShinyAppProc -from tests.playwright.utils.deploy_utils import skip_on_webkit @skip_on_webkit diff --git a/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py b/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py index 3cf6ab035..d38f35807 100644 --- a/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py +++ b/tests/playwright/shiny/components/chat/transform_assistant/test_chat_transform_assistant.py @@ -1,9 +1,9 @@ from playwright.sync_api import Page, expect +from utils.deploy_utils import skip_on_webkit from shiny import ui from shiny.playwright import controller from shiny.run import ShinyAppProc -from tests.playwright.utils.deploy_utils import skip_on_webkit @skip_on_webkit