How to get the post_name when in preview?

is_preview() is supported. You may also want to look into is_singular() which covers posts, pages, and attachments.