Merge pull request #767 from shenchucheng/feature-selenium-ut-debugger

skip Selenium web browser engine test if the browser is not installed.
This commit is contained in:
geekan 2024-01-18 19:22:08 +08:00 committed by GitHub
commit 4a5ae1b4a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import browsers
import pytest
from metagpt.config2 import config
@ -12,9 +13,27 @@ from metagpt.utils.parse_html import WebPage
@pytest.mark.parametrize(
"browser_type, use_proxy, url, urls",
[
("chrome", True, "https://deepwisdom.ai", ("https://deepwisdom.ai",)),
("firefox", False, "https://deepwisdom.ai", ("https://deepwisdom.ai",)),
("edge", False, "https://deepwisdom.ai", ("https://deepwisdom.ai",)),
pytest.param(
"chrome",
True,
"https://deepwisdom.ai",
("https://deepwisdom.ai",),
marks=pytest.mark.skipif(not browsers.get("chrome"), reason="chrome browser not found"),
),
pytest.param(
"firefox",
False,
"https://deepwisdom.ai",
("https://deepwisdom.ai",),
marks=pytest.mark.skipif(not browsers.get("firefox"), reason="firefox browser not found"),
),
pytest.param(
"edge",
False,
"https://deepwisdom.ai",
("https://deepwisdom.ai",),
marks=pytest.mark.skipif(not browsers.get("msedge"), reason="edge browser not found"),
),
],
ids=["chrome-normal", "firefox-normal", "edge-normal"],
)