Commit 9130673
RandomCrocodile
test: fix flaky GUI protect test — deterministic tab navigation (#64)
Gui_ProtectSampleApp_ShowsSuccess intermittently failed at the Protect!
button lookup (~1 in 3 runs). Two root causes:
1. ByText("Protect!") ambiguously matched both the tab header and the
Protect! button (they share the caption), so the wrong element could
be clicked and the tab never actually got selected.
2. WPF virtualizes inactive tab content — the Protect! button does not
enter the UIA tree until the tab is selected AND rendered. The 5s
button-find timeout was too short under load.
Fix: match the tab by TabItem control type + name, Select() it and wait
for IsSelected, then find the button with a 15s timeout. 5/5 consecutive
full-suite runs now pass 3/3 (previously ~1/3 failed).1 parent d67f926 commit 9130673
1 file changed
Lines changed: 21 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
158 | 162 | | |
159 | | - | |
160 | 163 | | |
161 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
162 | 175 | | |
163 | 176 | | |
164 | 177 | | |
| |||
167 | 180 | | |
168 | 181 | | |
169 | 182 | | |
170 | | - | |
171 | | - | |
| 183 | + | |
| 184 | + | |
172 | 185 | | |
173 | 186 | | |
174 | 187 | | |
| |||
0 commit comments