Pregnant orrrr

So how soon after sex should I take a test ? I have a OBGYN appointment on the 19 and my period is due for the 20 and I had sexual act on the 31st of last month. He did t come but he usually produces a lot of precum it’s weird but he did this time.. I even rub the tip and he was oozing with pre cum I was like omg wow... but what do y’all think.