Skip to content

Commit

Permalink
Migrate forward_msg_cache cypress test to playwright (streamlit#7974)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-wihuang authored Jan 19, 2024
1 parent 79292ff commit a2e694b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 32 deletions.
32 changes: 0 additions & 32 deletions e2e/specs/forward_msg_cache.spec.js

This file was deleted.

5 changes: 5 additions & 0 deletions e2e_playwright/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,8 @@ def compare(

if test_failure_messages:
pytest.fail("Missing snapshots: \n" + "\n".join(test_failure_messages))


def rerun(page: Page):
page.keyboard.press("r")
wait_for_app_run(page)
File renamed without changes.
25 changes: 25 additions & 0 deletions e2e_playwright/forward_msg_cache_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from playwright.sync_api import Page, expect

from e2e_playwright.conftest import rerun


def test_forward_msg_cache_receives_msg(app: Page):
app.evaluate("window.streamlitDebug.clearForwardMsgCache()")
rerun(app)
expect(app.get_by_role("dialog")).not_to_be_visible()

app.expect_request("**/_stcore/message/")

0 comments on commit a2e694b

Please sign in to comment.