You can check for a faulty switch by if the lights show or not, flashing lights mean its not the switch
Second, if the automatic locking around the top of the windscreen is working, then it's the roof hydro unit that's gone. However if the catch system isn't working at the windscreen, then check the fuses.
If the locking system is working, then hold the button to unlock automatically, and I'm assuming the hydro unit isn't engaging and it just stops. Then you can pull the red cable in the boot and it will bypass the hydro unit, the roof will move freely, like on a car without a electric roof.
Realistically if the motor is broken due to water ingress, the bypass button has probably seized so the roof won't move freely.
A new motor is £300 from Lincoln Sopers and is a 2 man job to replace. Whilst an easy job, it will take some time as you can't rush it. I'd also recommend the hydro unit housing is replaced at the same time. See shipkillers tutorial for step by step instructions.