test_1847971_ebay_com.py (842B)
1 import pytest 2 3 URL = "https://www.ebay.com/sl/prelist/suggest" 4 5 KEYBOARD_HERO_BUTTON_CSS = ".keyword-suggestion button:has(svg)" 6 SCANNER_BUTTON_CSS = ".keyword-suggestion button[aria-label='Scan barcode']" 7 SCANNER_POPUP_CHECK_CSS = ".barcodeReader video" 8 9 10 @pytest.mark.only_platforms("android") 11 @pytest.mark.asyncio 12 @pytest.mark.with_interventions 13 async def test_enabled(client): 14 await client.navigate(URL) 15 client.await_css(SCANNER_BUTTON_CSS, is_displayed=True).click() 16 client.await_css(SCANNER_POPUP_CHECK_CSS, is_displayed=True) 17 18 19 @pytest.mark.only_platforms("android") 20 @pytest.mark.asyncio 21 @pytest.mark.without_interventions 22 async def test_disabled(client): 23 await client.navigate(URL) 24 client.await_css(KEYBOARD_HERO_BUTTON_CSS, is_displayed=True) 25 assert not client.find_css(SCANNER_BUTTON_CSS, is_displayed=True)