You need to make sure your visit visa does not expire apply for an extension,then get married and apply for PR but you have to make sure your visa is always valid and at anytime you are here PR in process or not they can send you back but unlikely.
You need to get as much proof to show that you had a relationship before marriage and after.