e2e-tests: fix Google device code regex capturing label instead of code - #1720
e2e-tests: fix Google device code regex capturing label instead of code#1720adombeck wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Google broker device-code extraction regex used by the e2e test suite to avoid OCR occasionally capturing the “Login code” label instead of the actual device code during GDM-driven device-code login flows.
Changes:
- Adjust Google
DEVICE_URL_REGEXto make the colon optional and tolerate the code appearing on the next line. - Tighten the captured code character class to prevent swallowing multi-word labels when OCR drops punctuation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
10afc4d to
9fdc626
Compare
|
Waiting for CI before marking as ready for review |
|
CI is failing because of #1730. Waiting until that's fixed. |
9fdc626 to
3b409d4
Compare
Actually, #1730 only affects the authd-msentraid tests and this change only affects the authd-google tests, so we don't have to wait. Looking at the test results, the regex change from 9fdc626 was not good, it included other GDM UI text in the match. Copilot came up with an even more convoluted regex to avoid that. It's not pretty but IMO if it works reliably then it's fine. |
221ab31 to
8fd8ecd
Compare
GDM may separate the device-code label from its value, while OCR can omit the label colon and introduce whitespace between code characters. Accept two or more three- or four-letter segments without allowing adjacent dialog text to be entered into the browser. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8fd8ecd to
caa2b68
Compare
When GDM renders the qrcode layout it displays the 'Login code:' label and the actual code as separate UI widgets, so they appear on separate lines in the GDM dialog. When OCR of the GDM screen also drops the colon (a common OCR failure), the alternation in DEVICE_URL_REGEX falls through to the \s* branch, and the capture group — which included a literal space — greedily matched the two-word label 'Login code', producing 'LOGINCODE' instead of the real code.
Two changes close the gap:
Closes #1719
UDENG-10984