When can I test for pregnancy? Do I wait until my AF is late?

My next period is in like 5-7 days, unless I’m pregnant, obviously. Can I test before that? Or do I have to wait until I’m late?