Thanks Mike Stangel for the detailed response. I'm glad you are making progress.
I couldnt think of a better way of sharing screenshots with you so here are some links to Google Drive for images:
https://drive.google.com/file/d/1s7XDW6FvPyT0uWae9es97bXA4Osy-RGm/v... - original (23/03) authentication error captured from automated flow as screenshot on fail
https://drive.google.com/file/d/1WDREqohIfPqkyuTRhStM_7yeVc_y6I9D/v... - today (30/03) authentication error captured from automated flow as screenshot on fail. Looks identical to previous to me.
https://drive.google.com/file/d/1-Z7pWNBuMUZAUIMJCD3tgLJJ0YGW8xUr/v... - screenshot of error described yesterday as "weird behaviour" when utilising a regular Chrome session with Geni
I hope that these will be of some use to you - the automated auth flow is entirely reproducible but in a way I dont understand.
If I do 2 consecutive iterations of the same test then the first one ALWAYS succeeds and the second one ALWAYS fails with the auth error.
If I execute the second iteration without the first then it ALWAYS passes. So there is a dependency between the 2 iterations that didnt previously exist.
From the app side each iteration commences from an identical, reproducible start point as the previous access token is always removed as a first step.
I tried introducing a wait of 2 seconds between both iterations thinking it could be some kind of timing issue, but this didnt change anything.
If I run a full test suite then I get 13 initial failures.
If I rerun just the 13 failures, 5 of them then fail, then 2, then 1 until the last test runs and passes on its own.
This shows that each isolated interaction behaves as expected but something unpredictable is happening now when they are run in sequence. Previously the full test suite would run 100% successfully at the first attempt with no failures
The captcha thing is still a mystery to me as I dont have any automated tests that are coded to expect a login fail and only ever authenticate as part of a flow exactly as you have described in your last message.
However I do start each automated test with a request for a new access token (apart from the tests specifically testing the use of a saved token).
In normal interaction with my app the access and refresh tokens are stored and utilised as intended.
If there is going to be a need to respond to a Captcha in a normal, non-failure API flow, then I am going to be stumped to automate this unless a) I know when to expect the Captcha and b) I can automate the interaction by clicking a checkbox