Skip to content

fix(ci): wait for code-server in healthcheck#2744

Closed
cidrblock wants to merge 1 commit into
ansible:mainfrom
cidrblock:fix/ci-selenium-readiness
Closed

fix(ci): wait for code-server in healthcheck#2744
cidrblock wants to merge 1 commit into
ansible:mainfrom
cidrblock:fix/ci-selenium-readiness

Conversation

@cidrblock
Copy link
Copy Markdown
Contributor

@cidrblock cidrblock commented Apr 16, 2026

Problem

test (linux) fails with 71% rate (#2580). Three independent issues:

  1. Selenium UI tests (healthcheck): Every test raises TimeoutException because the container healthcheck only validates Selenium Grid on :4444 — code-server on :8080 is still starting when tests begin, causing a 5-minute page-load timeout per test.

  2. Selenium UI tests (command palette): vscode_run_command() uses an XPath click on the command center element to open the command palette. The element is found but clicking it fails silently in code-server, causing a hidden 180s timeout (6 retries x 30s WebDriverWait).

  3. E2E tests: @vscode/test-electron times out after 15s while resolving the VS Code version from the CDN. The download.timeout config option was not being forwarded to the underlying download call due to a bug in @vscode/test-cli (download.timeout not passed to downloadAndUnzipVSCode in installDependentExtensions microsoft/vscode-test-cli#106).

Fix

Selenium UI tests — healthcheck

  • Healthcheck now verifies both services inside the container: curl -sf --max-time 3 http://localhost:4444 && curl -sf --max-time 3 http://localhost:8080.
  • Increased retries (10 → 30) and start_period (10s → 30s) to accommodate code-server startup time.
  • Removed accidental or True that forced container teardown/recreate on every run.
  • Replaced unbounded while True health loop with a deadline-based loop (360s default, configurable via UI_CONTAINER_HEALTH_TIMEOUT) with progressive logging.
  • Set page_load_timeout(120) and script_timeout(60) on WebDriver so tests fail fast instead of hanging 5+ minutes.
  • Exposed port 127.0.0.1:8080 for local debugging.

Selenium UI tests — command palette

  • Replaced brittle XPath-based command center click with F1 keyboard shortcut to open the command palette. This eliminates the dependency on code-server DOM structure.
  • Reduced worst-case timeout from 180s to 15s (3 attempts x 5s).
  • Added diagnostic logging throughout ensure_vscode_ready() and vscode_run_command() for CI visibility.

E2E download timeout

related: #2580

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to reduce flakiness/timeouts in the UI Selenium CI job by ensuring the test container is only considered “ready” once both Selenium Grid and code-server are responsive, and by adding bounded waiting + shorter Selenium timeouts in the Python fixtures.

Changes:

  • Update the container healthcheck to validate both :4444 (Selenium) and :8080 (code-server), and extend healthcheck timing tolerances.
  • Fix the UI fixture to stop force-recreating the container every run and replace an unbounded health loop with a deadline-based wait.
  • Configure Selenium WebDriver page-load and script timeouts to fail faster.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
test/ui/fixtures/ui_fixtures.py Makes container startup waiting bounded/configurable and sets WebDriver timeouts.
docker-compose.yml Expands the container healthcheck to include code-server and adjusts healthcheck timing; publishes port 8080.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/ui/fixtures/ui_fixtures.py Outdated
Comment thread test/ui/fixtures/ui_fixtures.py Outdated
Comment thread test/ui/fixtures/ui_fixtures.py
Comment thread docker-compose.yml Outdated
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@cidrblock has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 16 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 16 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: db68dc54-7dbf-42b2-8989-945734d84087

📥 Commits

Reviewing files that changed from the base of the PR and between 9b16937 and f7aace5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .vscode-test.mjs
  • docker-compose.yml
  • package.json
  • patches/@vscode__test-cli@0.0.12.patch
  • test/ui/fixtures/ui_fixtures.py
  • test/ui/utils/ui_utils.py
📝 Walkthrough

Walkthrough

Expose an additional service port and tighten Docker healthchecks for the Selenium VSCode service; replace an infinite container-health polling loop with bounded timeout-based polling and explicit failures in test fixtures; and add a download timeout configuration to the test runner config.

Changes

Cohort / File(s) Summary
Docker service
docker-compose.yml
Added host-binding port mapping 127.0.0.1:8080:8080. Changed healthcheck command to shell form: curl -sf --max-time 3 http://localhost:4444 && curl -sf --max-time 3 http://localhost:8080. Increased retries from 1030 and start_period from 10s30s.
Test fixture: container health & WebDriver timeouts
test/ui/fixtures/ui_fixtures.py
Removed unconditional health bypass; replaced while True polling with bounded polling until a deadline computed from UI_CONTAINER_HEALTH_TIMEOUT (parsed as int, default "360"). Call pytest.fail(...) on timeout or parse error. Increased poll sleep to 2s, emit elapsed/healthy logs, and set driver.set_page_load_timeout(120) and driver.set_script_timeout(60) after driver creation.
Test runner config
.vscode-test.mjs
Added download: { timeout: 60_000 } to the exported defineConfig object to control download timeout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through ports and checks so neat,
Curling two endpoints before I eat,
Timers set, no endless night,
Drivers wait, then spring to flight,
A little rabbit cheers the CI light 🌱✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(ci): wait for code-server in healthcheck' accurately summarizes the main change—improving the container healthcheck to validate code-server startup, which directly addresses the CI test failure issue described in the PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/ui/fixtures/ui_fixtures.py (1)

114-119: Apply the same fail-fast timeouts to new_browser too.

browser_setup now gets the shorter page/script timeouts, but new_browser at Lines 152-155 still uses Selenium's defaults. Keeping driver setup split like this makes the two fixtures drift again.

♻️ Minimal follow-up
     try:
         driver = WebDriver(
             command_executor="http://localhost:4444/wd/hub", options=options
         )
+        driver.set_page_load_timeout(120)
+        driver.set_script_timeout(60)
         driver.maximize_window()
         yield driver, "https://stage.ai.ansible.redhat.com/login", None
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/ui/fixtures/ui_fixtures.py` around lines 114 - 119, The new_browser
fixture still uses Selenium defaults; after it constructs the WebDriver instance
(the driver created in the new_browser fixture) call
driver.set_page_load_timeout(120) and driver.set_script_timeout(60) to match
browser_setup's timeouts; locate the WebDriver instantiation in new_browser and
add these two timeout calls immediately after driver creation (or factor both
fixtures to share a helper that applies these timeouts) so both fixtures fail
fast consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docker-compose.yml`:
- Line 16: Replace the hard-coded published port mapping "8080:8080" with a
loopback-bound, configurable mapping so the service only listens on localhost
and the host port can be changed; e.g. change the port mapping string to use an
env var and bind to 127.0.0.1 like "127.0.0.1:${CODE_SERVER_PORT:-8080}:8080"
(replace the existing "8080:8080" entry), and update any documentation or env
examples to include CODE_SERVER_PORT if needed.

---

Nitpick comments:
In `@test/ui/fixtures/ui_fixtures.py`:
- Around line 114-119: The new_browser fixture still uses Selenium defaults;
after it constructs the WebDriver instance (the driver created in the
new_browser fixture) call driver.set_page_load_timeout(120) and
driver.set_script_timeout(60) to match browser_setup's timeouts; locate the
WebDriver instantiation in new_browser and add these two timeout calls
immediately after driver creation (or factor both fixtures to share a helper
that applies these timeouts) so both fixtures fail fast consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 13fe9cc5-8d32-4c6e-9033-f44d1fa42cd1

📥 Commits

Reviewing files that changed from the base of the PR and between becf350 and eef94b6.

📒 Files selected for processing (2)
  • docker-compose.yml
  • test/ui/fixtures/ui_fixtures.py

Comment thread docker-compose.yml Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
1549 5 1544 113
View the top 3 failed test(s) by shortest run time
test/ui/test_00_commands.py::test_create_empty_playbook
Stack Traces | 7.18s run time
browser_setup = (<selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>, 'https://stage.ai.ansible.redhat.com/login')
screenshot_on_fail = None, close_editors = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_create_empty_playbook#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        browser_setup: Any,#x1B[90m#x1B[39;49;00m
        screenshot_on_fail: Any,#x1B[90m#x1B[39;49;00m
        close_editors: Any,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Test the 'Create an empty Ansible playbook' command."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        driver, _ = browser_setup#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        ensure_vscode_ready(driver)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        vscode_run_command(driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>ansible.create-empty-playbook#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       wait_displayed(#x1B[90m#x1B[39;49;00m
            driver,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m//div[contains(@class, #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mtab#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m) and contains(., #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mUntitled#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m)]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            timeout=#x1B[94m2#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtest/ui/test_00_commands.py#x1B[0m:85: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../ui/utils/ui_utils.py#x1B[0m:61: in wait_displayed
    #x1B[0melm = wait.until(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.support.wait.WebDriverWait (session="093db259-00df-4a9a-b08c-776a4d8e1687")>
method = <function visibility_of_element_located.<locals>._predicate at 0x7fac63d15800>
message = ''

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92muntil#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, method: Callable[[D], Literal[#x1B[94mFalse#x1B[39;49;00m] | T], message: #x1B[96mstr#x1B[39;49;00m = #x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) -> T:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Wait until the method returns a value that is not False.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Calls the method provided with the driver as an argument until the#x1B[39;49;00m
    #x1B[33m    return value does not evaluate to ``False``.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Args:#x1B[39;49;00m
    #x1B[33m        method: A callable object that takes a WebDriver instance as an#x1B[39;49;00m
    #x1B[33m            argument.#x1B[39;49;00m
    #x1B[33m        message: Optional message for TimeoutException.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Returns:#x1B[39;49;00m
    #x1B[33m        The result of the last call to `method`.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Raises:#x1B[39;49;00m
    #x1B[33m        TimeoutException: If 'method' does not return a truthy value within#x1B[39;49;00m
    #x1B[33m            the WebDriverWait object's timeout.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Example:#x1B[39;49;00m
    #x1B[33m        >>> from selenium.webdriver.common.by import By#x1B[39;49;00m
    #x1B[33m        >>> from selenium.webdriver.support.ui import WebDriverWait#x1B[39;49;00m
    #x1B[33m        >>> from selenium.webdriver.support import expected_conditions as EC#x1B[39;49;00m
    #x1B[33m        >>>#x1B[39;49;00m
    #x1B[33m        >>> # Wait until an element is visible on the page#x1B[39;49;00m
    #x1B[33m        >>> wait = WebDriverWait(driver, 10)#x1B[39;49;00m
    #x1B[33m        >>> element = wait.until(EC.visibility_of_element_located((By.ID, "exampleId")))#x1B[39;49;00m
    #x1B[33m        >>> print(element.text)#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        screen = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        stacktrace = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        end_time = time.monotonic() + #x1B[96mself#x1B[39;49;00m._timeout#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[94mTrue#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                value = method(#x1B[96mself#x1B[39;49;00m._driver)#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m value:#x1B[90m#x1B[39;49;00m
                    #x1B[94mreturn#x1B[39;49;00m value#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._ignored_exceptions #x1B[94mas#x1B[39;49;00m exc:#x1B[90m#x1B[39;49;00m
                screen = #x1B[96mgetattr#x1B[39;49;00m(exc, #x1B[33m"#x1B[39;49;00m#x1B[33mscreen#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                stacktrace = #x1B[96mgetattr#x1B[39;49;00m(exc, #x1B[33m"#x1B[39;49;00m#x1B[33mstacktrace#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m time.monotonic() > end_time:#x1B[90m#x1B[39;49;00m
                #x1B[94mbreak#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            time.sleep(#x1B[96mself#x1B[39;49;00m._poll)#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m TimeoutException(message, screen, stacktrace)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       selenium.common.exceptions.TimeoutException: Message: #x1B[0m
#x1B[1m#x1B[31mE       Stacktrace:#x1B[0m
#x1B[1m#x1B[31mE       RemoteError@chrome:.../content/shared/RemoteError.sys.mjs:8:8#x1B[0m
#x1B[1m#x1B[31mE       WebDriverError@chrome:.../shared/webdriver/Errors.sys.mjs:199:5#x1B[0m
#x1B[1m#x1B[31mE       NoSuchElementError@chrome:.../shared/webdriver/Errors.sys.mjs:552:5#x1B[0m
#x1B[1m#x1B[31mE       dom.find/</<@chrome:.../content/shared/DOM.sys.mjs:136:16#x1B[0m

#x1B[1m#x1B[31m../../../..../vsa/lib/python3.13.../webdriver/support/wait.py#x1B[0m:121: TimeoutException
test/ui/test_02_welcome_webviews.py::test_header_and_subtitle
Stack Traces | 12.6s run time
browser_setup = (<selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>, 'https://stage.ai.ansible.redhat.com/login')
screenshot_on_fail = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_header_and_subtitle#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        browser_setup: Any,#x1B[90m#x1B[39;49;00m
        screenshot_on_fail: Any,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Test welcome page displays correct header and subtitle."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        driver, _ = browser_setup#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        ensure_vscode_ready(driver)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Open welcome page explicitly#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        vscode_run_command(driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>ansible.content-creator.menu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       header_title = find_element_across_iframes(#x1B[90m#x1B[39;49;00m
            driver,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m//h1[text()=#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mAnsible Development Tools#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            retries=#x1B[94m10#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtest/ui/test_02_welcome_webviews.py#x1B[0m:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

driver = <selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>
xpath = "//h1[text()='Ansible Development Tools']", retries = 10

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mfind_element_across_iframes#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        driver: WebDriver,#x1B[90m#x1B[39;49;00m
        xpath: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        retries: #x1B[96mint#x1B[39;49;00m = #x1B[94m3#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> WebElement:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Loop over all iframes and nested iframes and return first matching element.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Args:#x1B[39;49;00m
    #x1B[33m        driver: WebDriver instance#x1B[39;49;00m
    #x1B[33m        xpath: XPath selector for the element#x1B[39;49;00m
    #x1B[33m        retries: Number of retry attempts#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Returns:#x1B[39;49;00m
    #x1B[33m        The first matching WebElement#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Raises:#x1B[39;49;00m
    #x1B[33m        ValueError: If element not found after all retries#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m _ #x1B[95min#x1B[39;49;00m #x1B[96mrange#x1B[39;49;00m(retries):#x1B[90m#x1B[39;49;00m
            driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m contextlib.suppress(NoSuchElementException):#x1B[90m#x1B[39;49;00m
                #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
            iframes = driver.find_elements(By.XPATH, #x1B[33m"#x1B[39;49;00m#x1B[33m//iframe#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m iframe #x1B[95min#x1B[39;49;00m iframes:#x1B[90m#x1B[39;49;00m
                driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
                driver.switch_to.frame(iframe)#x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m contextlib.suppress(NoSuchElementException):#x1B[90m#x1B[39;49;00m
                    #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m contextlib.suppress(#x1B[90m#x1B[39;49;00m
                    NoSuchElementException,#x1B[90m#x1B[39;49;00m
                    NoSuchFrameException,#x1B[90m#x1B[39;49;00m
                    StaleElementReferenceException,#x1B[90m#x1B[39;49;00m
                ):#x1B[90m#x1B[39;49;00m
                    nested_iframes = driver.find_elements(By.XPATH, #x1B[33m"#x1B[39;49;00m#x1B[33m//iframe#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                    #x1B[94mfor#x1B[39;49;00m ni #x1B[95min#x1B[39;49;00m nested_iframes:#x1B[90m#x1B[39;49;00m
                        #x1B[94mwith#x1B[39;49;00m contextlib.suppress(#x1B[90m#x1B[39;49;00m
                            NoSuchElementException,#x1B[90m#x1B[39;49;00m
                            NoSuchFrameException,#x1B[90m#x1B[39;49;00m
                            StaleElementReferenceException,#x1B[90m#x1B[39;49;00m
                        ):#x1B[90m#x1B[39;49;00m
                            driver.switch_to.frame(ni)#x1B[90m#x1B[39;49;00m
                            #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
                        driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
                driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
            time.sleep(#x1B[94m1#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33melement not found: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mxpath#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       ValueError: element not found: //h1[text()='Ansible Development Tools']#x1B[0m

#x1B[1m#x1B[.../ui/utils/ui_utils.py#x1B[0m:588: ValueError
test/ui/test_02_welcome_webviews.py::test_mcp_section
Stack Traces | 20.7s run time
browser_setup = (<selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>, 'https://stage.ai.ansible.redhat.com/login')
screenshot_on_fail = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_mcp_section#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        browser_setup: Any,#x1B[90m#x1B[39;49;00m
        screenshot_on_fail: Any,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Test welcome page displays MCP Server section correctly."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        driver, _ = browser_setup#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        ensure_vscode_ready(driver)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Open welcome page explicitly#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        vscode_run_command(driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>ansible.content-creator.menu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        start_section = find_element_across_iframes(#x1B[90m#x1B[39;49;00m
            driver,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m//div[contains(@class, #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mindex-list#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m) and contains(@class, #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mstart-container#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m)]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            retries=#x1B[94m20#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[94massert#x1B[39;49;00m start_section #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mStart section should be present#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       mcp_server_option = find_element_across_iframes(#x1B[90m#x1B[39;49;00m
            driver,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m//*[contains(text(), #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mAnsible Development Tools MCP Server (AI)#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m)]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            retries=#x1B[94m10#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtest/ui/test_02_welcome_webviews.py#x1B[0m:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

driver = <selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>
xpath = "//*[contains(text(), 'Ansible Development Tools MCP Server (AI)')]"
retries = 10

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mfind_element_across_iframes#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        driver: WebDriver,#x1B[90m#x1B[39;49;00m
        xpath: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        retries: #x1B[96mint#x1B[39;49;00m = #x1B[94m3#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> WebElement:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Loop over all iframes and nested iframes and return first matching element.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Args:#x1B[39;49;00m
    #x1B[33m        driver: WebDriver instance#x1B[39;49;00m
    #x1B[33m        xpath: XPath selector for the element#x1B[39;49;00m
    #x1B[33m        retries: Number of retry attempts#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Returns:#x1B[39;49;00m
    #x1B[33m        The first matching WebElement#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Raises:#x1B[39;49;00m
    #x1B[33m        ValueError: If element not found after all retries#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m _ #x1B[95min#x1B[39;49;00m #x1B[96mrange#x1B[39;49;00m(retries):#x1B[90m#x1B[39;49;00m
            driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m contextlib.suppress(NoSuchElementException):#x1B[90m#x1B[39;49;00m
                #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
            iframes = driver.find_elements(By.XPATH, #x1B[33m"#x1B[39;49;00m#x1B[33m//iframe#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m iframe #x1B[95min#x1B[39;49;00m iframes:#x1B[90m#x1B[39;49;00m
                driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
                driver.switch_to.frame(iframe)#x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m contextlib.suppress(NoSuchElementException):#x1B[90m#x1B[39;49;00m
                    #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m contextlib.suppress(#x1B[90m#x1B[39;49;00m
                    NoSuchElementException,#x1B[90m#x1B[39;49;00m
                    NoSuchFrameException,#x1B[90m#x1B[39;49;00m
                    StaleElementReferenceException,#x1B[90m#x1B[39;49;00m
                ):#x1B[90m#x1B[39;49;00m
                    nested_iframes = driver.find_elements(By.XPATH, #x1B[33m"#x1B[39;49;00m#x1B[33m//iframe#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                    #x1B[94mfor#x1B[39;49;00m ni #x1B[95min#x1B[39;49;00m nested_iframes:#x1B[90m#x1B[39;49;00m
                        #x1B[94mwith#x1B[39;49;00m contextlib.suppress(#x1B[90m#x1B[39;49;00m
                            NoSuchElementException,#x1B[90m#x1B[39;49;00m
                            NoSuchFrameException,#x1B[90m#x1B[39;49;00m
                            StaleElementReferenceException,#x1B[90m#x1B[39;49;00m
                        ):#x1B[90m#x1B[39;49;00m
                            driver.switch_to.frame(ni)#x1B[90m#x1B[39;49;00m
                            #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
                        driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
                driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
            time.sleep(#x1B[94m1#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33melement not found: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mxpath#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       ValueError: element not found: //*[contains(text(), 'Ansible Development Tools MCP Server (AI)')]#x1B[0m

#x1B[1m#x1B[.../ui/utils/ui_utils.py#x1B[0m:588: ValueError
test/ui/test_02_welcome_webviews.py::test_sidebar_nav
Stack Traces | 27.2s run time
browser_setup = (<selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>, 'https://stage.ai.ansible.redhat.com/login')
modify_vscode_settings = None, screenshot_on_fail = None

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.mark.modify_settings({#x1B[33m"#x1B[39;49;00m#x1B[33mansible.lightspeed.enabled#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m: #x1B[94mFalse#x1B[39;49;00m})#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_sidebar_nav#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        browser_setup: Any,#x1B[90m#x1B[39;49;00m
        modify_vscode_settings: Any,#x1B[90m#x1B[39;49;00m
        screenshot_on_fail: Any,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Test sidebar navigation to welcome page."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        driver, _ = browser_setup#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        ensure_vscode_ready(driver)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        vscode_run_command(driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>Ansible: Focus on Ansible Development Tools View#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        get_started_link = find_element_across_iframes(#x1B[90m#x1B[39;49;00m
            driver,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m//a[contains(@title, #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mAnsible Development Tools welcome page#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m)]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            retries=#x1B[94m10#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[94massert#x1B[39;49;00m get_started_link #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mGet started link should be present in sidebar#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Open welcome page via command palette (command: URI clicks are#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[90m# unreliable inside webview iframes on code-server in CI).#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        vscode_run_command(driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>ansible.content-creator.menu#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       find_element_across_iframes(#x1B[90m#x1B[39;49;00m
            driver,#x1B[90m#x1B[39;49;00m
            #x1B[33m"#x1B[39;49;00m#x1B[33m//h1[text()=#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mAnsible Development Tools#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            retries=#x1B[94m20#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtest/ui/test_02_welcome_webviews.py#x1B[0m:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

driver = <selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>
xpath = "//h1[text()='Ansible Development Tools']", retries = 20

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mfind_element_across_iframes#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        driver: WebDriver,#x1B[90m#x1B[39;49;00m
        xpath: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        retries: #x1B[96mint#x1B[39;49;00m = #x1B[94m3#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> WebElement:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Loop over all iframes and nested iframes and return first matching element.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Args:#x1B[39;49;00m
    #x1B[33m        driver: WebDriver instance#x1B[39;49;00m
    #x1B[33m        xpath: XPath selector for the element#x1B[39;49;00m
    #x1B[33m        retries: Number of retry attempts#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Returns:#x1B[39;49;00m
    #x1B[33m        The first matching WebElement#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Raises:#x1B[39;49;00m
    #x1B[33m        ValueError: If element not found after all retries#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m _ #x1B[95min#x1B[39;49;00m #x1B[96mrange#x1B[39;49;00m(retries):#x1B[90m#x1B[39;49;00m
            driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
            #x1B[94mwith#x1B[39;49;00m contextlib.suppress(NoSuchElementException):#x1B[90m#x1B[39;49;00m
                #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
            iframes = driver.find_elements(By.XPATH, #x1B[33m"#x1B[39;49;00m#x1B[33m//iframe#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m iframe #x1B[95min#x1B[39;49;00m iframes:#x1B[90m#x1B[39;49;00m
                driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
                driver.switch_to.frame(iframe)#x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m contextlib.suppress(NoSuchElementException):#x1B[90m#x1B[39;49;00m
                    #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
                #x1B[94mwith#x1B[39;49;00m contextlib.suppress(#x1B[90m#x1B[39;49;00m
                    NoSuchElementException,#x1B[90m#x1B[39;49;00m
                    NoSuchFrameException,#x1B[90m#x1B[39;49;00m
                    StaleElementReferenceException,#x1B[90m#x1B[39;49;00m
                ):#x1B[90m#x1B[39;49;00m
                    nested_iframes = driver.find_elements(By.XPATH, #x1B[33m"#x1B[39;49;00m#x1B[33m//iframe#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                    #x1B[94mfor#x1B[39;49;00m ni #x1B[95min#x1B[39;49;00m nested_iframes:#x1B[90m#x1B[39;49;00m
                        #x1B[94mwith#x1B[39;49;00m contextlib.suppress(#x1B[90m#x1B[39;49;00m
                            NoSuchElementException,#x1B[90m#x1B[39;49;00m
                            NoSuchFrameException,#x1B[90m#x1B[39;49;00m
                            StaleElementReferenceException,#x1B[90m#x1B[39;49;00m
                        ):#x1B[90m#x1B[39;49;00m
                            driver.switch_to.frame(ni)#x1B[90m#x1B[39;49;00m
                            #x1B[94mreturn#x1B[39;49;00m driver.find_element(By.XPATH, xpath)#x1B[90m#x1B[39;49;00m
                        driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
                driver.switch_to.default_content()#x1B[90m#x1B[39;49;00m
            time.sleep(#x1B[94m1#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33melement not found: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mxpath#x1B[33m}#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       ValueError: element not found: //h1[text()='Ansible Development Tools']#x1B[0m

#x1B[1m#x1B[.../ui/utils/ui_utils.py#x1B[0m:588: ValueError
test/ui/test_00_commands.py::test_terminal
Stack Traces | 74.2s run time
browser_setup = (<selenium.webdriver.remote.webdriver.WebDriver (session="093db259-00df-4a9a-b08c-776a4d8e1687")>, 'https://stage.ai.ansible.redhat.com/login')
screenshot_on_fail = None, close_editors = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_terminal#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        browser_setup: Any,#x1B[90m#x1B[39;49;00m
        screenshot_on_fail: Any,#x1B[90m#x1B[39;49;00m
        close_editors: Any,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Test terminal functionality."""#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        driver, _ = browser_setup#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        ensure_vscode_ready(driver)#x1B[90m#x1B[39;49;00m
        vscode_run_command(driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>workbench.action.terminal.new#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        vscode_run_command(driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>workbench.action.terminal.focus#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        time.sleep(#x1B[94m3#x1B[39;49;00m)  #x1B[90m# allow terminal to start before sending input#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        vscode_run_command(#x1B[90m#x1B[39;49;00m
            driver, #x1B[33m"#x1B[39;49;00m#x1B[33m>workbench.action.terminal.sendSequence#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33madt --version#x1B[39;49;00m#x1B[33m\\#x1B[39;49;00m#x1B[33mn#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        output: WebElement | #x1B[94mNone#x1B[39;49;00m = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mcheck_output#x1B[39;49;00m() -> #x1B[96mbool#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mnonlocal#x1B[39;49;00m output#x1B[90m#x1B[39;49;00m
            output = driver.find_element(#x1B[90m#x1B[39;49;00m
                by=#x1B[33m"#x1B[39;49;00m#x1B[33mxpath#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, value=#x1B[33m"#x1B[39;49;00m#x1B[33m//div[@class=#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33mterminal-xterm-host#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            )#x1B[90m#x1B[39;49;00m
            log.info(#x1B[33m"#x1B[39;49;00m#x1B[33mterminal output: #x1B[39;49;00m#x1B[33m%s#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, output.text)#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m #x1B[33m"#x1B[39;49;00m#x1B[33mtox-ansible#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m #x1B[95min#x1B[39;49;00m output.text#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        errors = [NoSuchElementException, ElementNotInteractableException]#x1B[90m#x1B[39;49;00m
        wait = WebDriverWait(#x1B[90m#x1B[39;49;00m
            driver, timeout=#x1B[94m10#x1B[39;49;00m, poll_frequency=#x1B[94m0.5#x1B[39;49;00m, ignored_exceptions=errors#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
>       wait.until(#x1B[94mlambda#x1B[39;49;00m _: check_output())#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtest/ui/test_00_commands.py#x1B[0m:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.support.wait.WebDriverWait (session="093db259-00df-4a9a-b08c-776a4d8e1687")>
method = <function test_terminal.<locals>.<lambda> at 0x7fac63d17920>
message = ''

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92muntil#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m, method: Callable[[D], Literal[#x1B[94mFalse#x1B[39;49;00m] | T], message: #x1B[96mstr#x1B[39;49;00m = #x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) -> T:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Wait until the method returns a value that is not False.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Calls the method provided with the driver as an argument until the#x1B[39;49;00m
    #x1B[33m    return value does not evaluate to ``False``.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Args:#x1B[39;49;00m
    #x1B[33m        method: A callable object that takes a WebDriver instance as an#x1B[39;49;00m
    #x1B[33m            argument.#x1B[39;49;00m
    #x1B[33m        message: Optional message for TimeoutException.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Returns:#x1B[39;49;00m
    #x1B[33m        The result of the last call to `method`.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Raises:#x1B[39;49;00m
    #x1B[33m        TimeoutException: If 'method' does not return a truthy value within#x1B[39;49;00m
    #x1B[33m            the WebDriverWait object's timeout.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Example:#x1B[39;49;00m
    #x1B[33m        >>> from selenium.webdriver.common.by import By#x1B[39;49;00m
    #x1B[33m        >>> from selenium.webdriver.support.ui import WebDriverWait#x1B[39;49;00m
    #x1B[33m        >>> from selenium.webdriver.support import expected_conditions as EC#x1B[39;49;00m
    #x1B[33m        >>>#x1B[39;49;00m
    #x1B[33m        >>> # Wait until an element is visible on the page#x1B[39;49;00m
    #x1B[33m        >>> wait = WebDriverWait(driver, 10)#x1B[39;49;00m
    #x1B[33m        >>> element = wait.until(EC.visibility_of_element_located((By.ID, "exampleId")))#x1B[39;49;00m
    #x1B[33m        >>> print(element.text)#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        screen = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        stacktrace = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        end_time = time.monotonic() + #x1B[96mself#x1B[39;49;00m._timeout#x1B[90m#x1B[39;49;00m
        #x1B[94mwhile#x1B[39;49;00m #x1B[94mTrue#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                value = method(#x1B[96mself#x1B[39;49;00m._driver)#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m value:#x1B[90m#x1B[39;49;00m
                    #x1B[94mreturn#x1B[39;49;00m value#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._ignored_exceptions #x1B[94mas#x1B[39;49;00m exc:#x1B[90m#x1B[39;49;00m
                screen = #x1B[96mgetattr#x1B[39;49;00m(exc, #x1B[33m"#x1B[39;49;00m#x1B[33mscreen#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
                stacktrace = #x1B[96mgetattr#x1B[39;49;00m(exc, #x1B[33m"#x1B[39;49;00m#x1B[33mstacktrace#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m time.monotonic() > end_time:#x1B[90m#x1B[39;49;00m
                #x1B[94mbreak#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            time.sleep(#x1B[96mself#x1B[39;49;00m._poll)#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m TimeoutException(message, screen, stacktrace)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       selenium.common.exceptions.TimeoutException: Message: #x1B[0m
#x1B[1m#x1B[31mE       Stacktrace:#x1B[0m
#x1B[1m#x1B[31mE       RemoteError@chrome:.../content/shared/RemoteError.sys.mjs:8:8#x1B[0m
#x1B[1m#x1B[31mE       WebDriverError@chrome:.../shared/webdriver/Errors.sys.mjs:199:5#x1B[0m
#x1B[1m#x1B[31mE       NoSuchElementError@chrome:.../shared/webdriver/Errors.sys.mjs:552:5#x1B[0m
#x1B[1m#x1B[31mE       dom.find/</<@chrome:.../content/shared/DOM.sys.mjs:136:16#x1B[0m

#x1B[1m#x1B[31m../../../..../vsa/lib/python3.13.../webdriver/support/wait.py#x1B[0m:121: TimeoutException

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@cidrblock cidrblock closed this Apr 16, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in 🧰 devtools project board Apr 16, 2026
@cidrblock cidrblock reopened this Apr 16, 2026
@cidrblock cidrblock force-pushed the fix/ci-selenium-readiness branch from 9b16937 to 213694d Compare April 16, 2026 16:05
@cidrblock cidrblock force-pushed the fix/ci-selenium-readiness branch 2 times, most recently from cf010c3 to 461e33e Compare April 16, 2026 16:42
@cidrblock cidrblock force-pushed the fix/ci-selenium-readiness branch from 461e33e to ef7daff Compare April 16, 2026 17:14
The compose healthcheck only validated Selenium Grid (:4444),
so the container was marked healthy before code-server (:8080)
finished starting. Tests hit the default 5-minute page-load
timeout, burning ~6 min per test until the 30-min job limit.

- Healthcheck now verifies both :4444 and :8080 inside the
  container so `podman healthcheck run` blocks until both
  services are ready.
- Remove accidental `or True` that forced container recreate.
- Replace unbounded `while True` with a deadline-based loop
  (300 s default, configurable via UI_CONTAINER_HEALTH_TIMEOUT).
- Set page-load and script timeouts on WebDriver for faster
  failure when code-server is slow.
- Expose port 8080 for local debugging.

related: ansible#2580
Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants