I was part of a crew that was tested about 10 min before pushback. The guy's showed up at the jetway and said take this test and then be on your way.
This was about 3 years ago.
It has been going on for a while and ALPA knew and warned us to expect it.