| | |
| | | columns = root.get("waterfallColumns", []) |
| | | require(report.get("snapshotLoaded") is True, "snapshotLoaded must be true") |
| | | require(report.get("appCount") == fixture_app_count, "fixture appCount must match") |
| | | require(report.get("windowCount") == fixture_app_count * fixture_windows_per_app, "fixture windowCount must match") |
| | | require(root.get("waterfallViewMode") == "verticalColumns", "window shortcut fixture must run in vertical Waterfall") |
| | | require(root.get("keyboardCommandsApplied") == expected_sequence, "two-key window shortcut commands must match") |
| | | require(root.get("appShelfIndexKeyDownCount") == 2, "two-key window shortcut must exercise two physical keyDown events") |
| | |
| | | require(target_app_index < len(columns), "target App index must exist") |
| | | target_column = columns[target_app_index] |
| | | cards = target_column.get("cards", []) |
| | | require(target_window_index < len(cards), "target window index must exist") |
| | | target_card = cards[target_window_index] |
| | | require(target_card.get("windowShortcutCode") == expected_code, "target card must expose expected two-character shortcut code") |
| | | require(target_card.get("primarySpaceLabel") != target_card.get("windowShortcutCode"), "shortcut code must replace the old Space label in the UI meta slot") |
| | | expected_window_count = fixture_app_count * fixture_windows_per_app |
| | | actual_window_count = report.get("windowCount") |
| | | suppressed_window_ids = set(report.get("suppressedActivationWindowIDs", [])) |
| | | committed_window_id = root.get("lastCommittedWindowID") |
| | | pre_commit = root.get("lastWindowShortcutPreCommitFilterSnapshot", {}) |
| | | window_count_is_valid = ( |
| | | actual_window_count == expected_window_count |
| | | or ( |
| | | actual_window_count == expected_window_count - 1 |
| | | and committed_window_id in suppressed_window_ids |
| | | and root.get("lastCommitSource") == "keyboard" |
| | | ) |
| | | ) |
| | | require(window_count_is_valid, "fixture windowCount must match or only suppress committed target") |
| | | require(pre_commit.get("phase") == "targetPreCommit", "two-key shortcut must record a pre-commit filter snapshot") |
| | | require(pre_commit.get("targetCode") == expected_code, "pre-commit snapshot must record target shortcut code") |
| | | require(pre_commit.get("targetWindowID") == committed_window_id, "pre-commit target must match committed window ID") |
| | | require(pre_commit.get("matchedWindowIDs") == [committed_window_id], "pre-commit snapshot must match exactly the committed window") |
| | | if target_window_index < len(cards) and cards[target_window_index].get("windowID") == committed_window_id: |
| | | target_card = cards[target_window_index] |
| | | require(target_card.get("windowShortcutCode") == expected_code, "target card must expose expected two-character shortcut code") |
| | | require(target_card.get("primarySpaceLabel") != target_card.get("windowShortcutCode"), "shortcut code must replace the old Space label in the UI meta slot") |
| | | else: |
| | | current_window_ids = [card.get("windowID") for column in columns for card in column.get("cards", [])] |
| | | require(committed_window_id in suppressed_window_ids, "committed target may be absent only when suppression records it") |
| | | require(committed_window_id not in current_window_ids, "suppressed committed target must not remain in current cards") |
| | | require(root.get("lastCommittedAppGroupIndex") == target_app_index, "two-key shortcut must commit target App") |
| | | require(root.get("lastCommittedWindowIndex") == target_window_index, "two-key shortcut must commit target window") |
| | | require(root.get("lastCommittedWindowID") == target_card.get("windowID"), "two-key shortcut must commit target window ID") |
| | | require(root.get("lastCommitSource") == "keyboard", "two-key shortcut commit must be keyboard sourced") |
| | | require(root.get("selectedAppGroupIndex") == target_app_index, "two-key shortcut must select target App") |
| | | require(root.get("selectedWindowIndex") == target_window_index, "two-key shortcut must select target window") |
| | | require(root.get("selectedWindowID") == target_card.get("windowID"), "two-key shortcut selection ID must match target window") |
| | | if actual_window_count == expected_window_count: |
| | | require(root.get("selectedAppGroupIndex") == target_app_index, "two-key shortcut must select target App") |
| | | require(root.get("selectedWindowIndex") == target_window_index, "two-key shortcut must select target window") |
| | | require(root.get("selectedWindowID") == committed_window_id, "two-key shortcut selection ID must match target window") |
| | | |
| | | for column in columns: |
| | | for card in column.get("cards", []): |