test(e2e): fix session-test pollution (stop session between tests)#32
Open
hikaps wants to merge 1 commit into
Open
test(e2e): fix session-test pollution (stop session between tests)#32hikaps wants to merge 1 commit into
hikaps wants to merge 1 commit into
Conversation
sessionRunner is a global manager that persists across tests; a test that starts a session but never stops it (test_two_instances_launch) left the Start/Stop toolbar action on 'Stop Session', so the next test's wait for 'Start Session' timed out. test_streaming_session_calls_helper failed in-suite despite passing in isolation. Add stop_session_if_running() (navigate to SessionSetup, click Stop if present) called from a class-scoped autouse fixture in TestSessionLifecycle. Scoped to session tests so the other ~43 tests pay no per-test navigation overhead (applying it globally pushed the suite past the 30-min ceiling). Verified: full e2e suite now 52 tests, 0 failures (was 1 failed).
c53d9a6 to
0d42285
Compare
hikaps
added a commit
that referenced
this pull request
Jul 8, 2026
…ot capture)
Reliability pass over the appium suite so existing tests mean what they say:
- conftest.select_combo_option: bump popup-open wait to 0.5s and add a guarded post-selection value check. NOTE: in selenium-webdriver-at-spi the Qt ComboBox Value interface is unimplemented (get_attribute('value') raises NotImplementedError) and .text returns the label, not the selection, so the check is currently a safe no-op that activates if the driver gains Value support; it never false-fires.
- conftest.stop_session_if_running (PR #32): use DEFAULT_TIMEOUT for navigation/detection waits; the prior timeout=2 could swallow a slow-navigation TimeoutException and leak a running session into the next test.
- test_home.test_home_shows_action_cards: assert the home cards exist instead of clicking a card then waiting for its own NAME (a no-op that always passed).
- base_test.navigate_to_device_assignment: wait for spinInstanceCount (page-only) instead of the NAME 'Assign Devices' that collides with the toolbar action.
- test_devices.test_switch_device_tabs: assert each clicked tab becomes selected (was click-and-assert-nothing).
- conftest screenshot capture: write under APPIUM_ARTIFACT_OUTPUT_PATH when set (writable in the container; the baked appiumtests/screenshots is root-owned) and log capture failures instead of swallowing them.
- Remove 17 tautological is_displayed() asserts that followed wait_for_element on the same element (presence already proven; they masked wrong-state elements).
cardLayoutGrid/comboScaling kept on NAME: their objectName does not propagate to AT-SPI in the SessionSetup context (siblings do).
Verified: full e2e suite 52 tests, 0 failures, 5 skipped (~19 min).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
test_streaming_session_calls_helperfailed in the full e2e suite (TimeoutException waiting for"Start Session") but passed in isolation. Root cause is test pollution, not the viewport.sessionRunneris a global manager that persists across tests.test_two_instances_launchclicks Start and never Stop, leavingrunning=true, so the Start/Stop toolbar action reads"Stop Session"— the next test'sclick_by_name("Start Session")times out.Fix
appiumtests/conftest.py— addstop_session_if_running(driver): navigate to SessionSetup → click"Stop Session"if present → wait for"Start Session".appiumtests/test_session.py—TestSessionLifecyclegets a class-scopedautousefixture (_stop_session_after) calling it after each test.Scoped to the session tests (where every polluter and victim lives) so the other ~43 tests pay no per-test navigation overhead. Applying it globally via
clean_stateworked but added ~13 min and pushed the suite past the 30-min ceiling.Verification
Full e2e suite (rootless container): 52 tests, 0 failures, 0 errors, 5 skipped (~19 min) — previously 1 failed. Both
test_two_instances_launchandtest_streaming_session_calls_helpernow pass.The 3 viewport-related skips (inline streaming controls off-screen in the small headless viewport) remain — separate, smaller issue (scroll-into-view or a larger nested-kwin output).