-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] Fix test args for --headless and --bidi #15567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
The issue that AI reviewer brought up (If anybody was previously invoking tests with |
https://bugs.webkit.org/show_bug.cgi?id=291616 Reviewed by Carlos Garcia Campos. - Selenium updated to 963bf958 (4.32 nightly) - Includes new bidi browser and network tests - Fix usage of `--bidi` pytest option after [1] - Drive-by gardening [1] SeleniumHQ/selenium#15567 * Tools/Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py: (WebDriverSeleniumExecutor.__init__): Fix usage of `--bidi` pytest option. * WebDriverTests/TestExpectations.json: * WebDriverTests/imported/selenium/common/src/web/bidi/logEntryAdded.html: * WebDriverTests/imported/selenium/common/src/web/cookie-background.html: Added. * WebDriverTests/imported/selenium/common/src/web/formPage.html: * WebDriverTests/imported/selenium/common/src/web/logEntryAdded.html: * WebDriverTests/imported/selenium/common/src/web/relative_locators.html: * WebDriverTests/imported/selenium/common/src/web/service-worker.js: Added. * WebDriverTests/imported/selenium/common/src/web/service_worker.html: Added. * WebDriverTests/imported/selenium/importer.json: * WebDriverTests/imported/selenium/py/conftest.py: * WebDriverTests/imported/selenium/py/selenium/__init__.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/actions/action_builder.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/bidi/browser.py: Added. * WebDriverTests/imported/selenium/py/selenium/webdriver/common/bidi/network.py: Added. * WebDriverTests/imported/selenium/py/selenium/webdriver/common/by.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/log.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/options.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/print_page_options.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/proxy.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/service.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/timeouts.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/utils.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/locator_converter.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/shadowroot.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/websocket_connection.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/safari/options.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/expected_conditions.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/relative_locator.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/select.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/wait.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/bidi_browser_tests.py: Added. * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/bidi_network_tests.py: Added. * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/cookie_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/fedcm_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/selenium_manager_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/remote/remote_downloads_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/safari/safari_service_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/support/relative_by_tests.py: Canonical link: https://commits.webkit.org/293953@main
User description
💥 What does this PR do?
This PR fixes some of the argument handling for invoking tests in the internal Python test suite.
Previously, to enable headless mode, you would pass
--headless=truewhen invoking PyTest. This worked fine, however, passing any value would enable headless mode (including--headless=false,--headless=False,--headless=0,--headless=no,--headless=what_the_hell_is_this, etc). This was rather confusing. Now to enable headless mode, you pass--headless. To run without headless mode, you just don't supply the argument. If you try to pass a value like--headless=value, it will raise an error.Similarly, the
--bidiarg was handled incorrectly. Bazel was invoking non-BiDi tests by passing--bidi=false, which had the effect of enabling BiDi mode. Now this arg works similar to--headless. You simply pass--bidito enable BiDi mode in tests, or leave the arg off to run in non-BiDi mode.I updated
py/BUILD.bazelto invoke tests in BiDi and Headless modes correctly.I also cleaned up some of the help strings.
🔄 Types of changes
PR Type
Bug fix, Enhancement
Description
Fixed argument handling for
--headlessand--bidiin Python tests.Updated Bazel build configurations to correctly handle test arguments.
Improved help text for test arguments in
pytest_addoption.Simplified logic for headless and BiDi mode detection.
Changes walkthrough 📝
conftest.py
Refined test argument handling and help textpy/conftest.py
--headlessand--biditostore_truefor better handling.headlessandbidimode detection.BUILD.bazel
Fixed Bazel test configurations for argumentspy/BUILD.bazel
--bidi=falseargument in test configurations.--bidiand--headlessarguments for proper usage.