If your connection test is successful, everything should be all right, though it the opposite is not correct, you could have a negative connection test BUT still be able to play.
The first thing is the firewall, when you test the connection the first time, the firewall should open up and ask you if the program should be allowed to go through the firewall. Answer yes, this should now be set for good and the firewall should not bother any more.
Then the port 27015:
You need to go inside the settings of your router and then inside the "Port Settings" section. There, set port 27015 to be redirected to your computer, so that all incoming connections through this port go directly to your PC, and not to another one on your local network / wifi.
This is different for every router, so there is no easy tutorial for this.
Use this topic to help / be helped on this!

Jerome