Okay - I have a different take on this: Do not tell your wife. You are remorseful, you understand what led you to this, you don't plan to ever let it happen again - that's enough for me. It will cause your wife untold pain if you tell her, and may keep you from ever having a good R again with her.
As for the doctor - how would your wife see the doctor bills? If that is likely to happen, you could go somewhere else and pay for the tests out of pocket. HIV testing of course is the big one, and can take three months to turn positive.
Also - you need to ask yourself some hard questions about why this happened. How did your marriage devolve into a sexless one? What are you resenting your wife for? Why would you sabotage your R with your W just as it is starting to improve?Read the Five Love Languages by Chapman and start speaking your wife's love languages to improve your R. Ellie