test_1827678_80180_books_com_tw.py (544B)
1 import pytest 2 3 URL = "https://viewer-ebook.books.com.tw/viewer/epub/?book_uni_id=0010763244_reflowable_trial" 4 5 SUPPORTED_CSS = ".epub-viewer" 6 UNSUPPORTED_TEXT = "Get Chrome" 7 8 9 @pytest.mark.asyncio 10 @pytest.mark.with_interventions 11 async def test_enabled(client): 12 await client.navigate(URL) 13 assert client.await_css(SUPPORTED_CSS) 14 15 16 @pytest.mark.asyncio 17 @pytest.mark.without_interventions 18 async def test_disabled(client): 19 await client.disable_window_alert() 20 await client.navigate(URL) 21 assert client.await_text(UNSUPPORTED_TEXT)