Thanks for the quick response Phil. That fixed the problem. But now I have a different issue.
When login is complete, control is redirected to another page. That page submits a background job to Sidekiq and then displays a screen with a META refresh of 15 seconds. When running live, this makes the page refresh every 15 seconds. Once the report has finished, the controller recognizes this and instead of generating the holding page, generates the report.
That’s how it works in development and production. In testing, there is no background job. So instead, I added a call inline within the test to run the background job. It works just fine, but the browser display never refreshes. And if I click the Refresh button on the browser screen, it acts like it’s doing something (dot running back and forth on tab’s header) but never finishes. And if I try “page.driver.refresh” (instead of clicking the page’s refresh button), nothing happens (no refresh, no running dot, etc).
I can accept that maybe the META Refresh is being ignored, but I would have though that page.driver.refresh would have refreshed the page, and that if that didn’t, then the refresh button would.
If I change the post-login action to redirect to a different page with no META refresh, it works just fine.