Yes you can take test at the terminal but it a very long process and a fee
I believe it depends on the cruise line. On a recent NCL trip, they had onsite testing available for a fee. Your cruise operator should be able to provide you with more information.
Thanks! Your answer is awaiting moderation.