import pytest

URL = "https://fbo.fubon.com/fboPortal/index.jsp"
FRAME_CSS = "frame[src*='indexm.jsp']"
SUPPORTED_CSS = "#id_no"
UNSUPPORTED_TEXT = "Unsupported Browser"


@pytest.mark.skip_platforms("linux")
@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
    await client.navigate(URL, wait="none")
    client.switch_to_frame(client.await_css(FRAME_CSS, timeout=30))
    assert client.await_css(SUPPORTED_CSS, is_displayed=True)
    assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True)


@pytest.mark.skip_platforms("linux")
@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
    await client.navigate(URL, wait="none")
    client.switch_to_frame(client.await_css(FRAME_CSS, timeout=30))
    assert client.await_text(UNSUPPORTED_TEXT, is_displayed=True)
    assert not client.find_css(SUPPORTED_CSS, is_displayed=True)
