Went to doctor for cystocele and I have painfulperiods, can't poop could my uterus be prolapsing also what kind of test needs to be done to determine?

Complete pelvic eval. Most likely cause; rectocele more than cystocele. Pelvic evaluation for endometriosis is important. And a fibroid uterus should be ruled out. A pelvic sonogram would be helpful. In summary; a thorough history and physical, with emphasis on the pelvic will serve you well.
Pop-q. You may need to see a gynecologist for a detailed examination of prolapse. In this examination your gynecologist will use a speculum and ask you to bear down during the exam to see what parts of your vagina definitely descend. He or she will also ask you about risk factors for prolapse and ways you can change your behavior to prevent worsening. Consider kegel exercises.