Commit 54ba867
authored
Update cookie validation regex in Get Cookies test
Fix flaky Get Cookies test
The previous regex used | to handle any cookie ordering, but the ^ and $ anchors were not wrapping both alternatives, leaving each side only partially anchored and allowing substring matches. For example, the first alternative only required the string to start with test=seleniumlibrary; another=value, meaning a third cookie appended at the end would still pass.
All 3 cookies were always being returned, but the test was silently passing in the past because the browser was consistently returning cookies in an order that accidentally satisfied the faulty regex.
Replaced the regex with a stricter pattern that matches exactly 3 known cookies in any order, with no room for unexpected extras.1 parent 423ebb8 commit 54ba867
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | | - | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
0 commit comments