wilcoxon test power


I want to study the power of the Wilcoxon test for the test :
H0 : Fx = Fy
against H1 : Fx = F1 > Fy = F2

F is the empirical distribution function
F1 = F(normal(0,1)) and F2 = F(normal(0.5,1))

here I'm trying to stimulate 50 samples of Z in order to have their p-values.
The aim is to evaluate using Monte Carlo the power of the Wilcoxon test.

Tn <- function (z,n1) {

pval <- function (z,B,nX){
  boot_sampl = c()
  for (i in 1:B){
    boot_sampl[i] = Tn(sample(z),nX) # bootstrap samples
  p = boot_sampl[boot_sampl>Tn(z,nX)]
  p_val = mean(p)

Is this correct?

How can I implement the Monte-Carlo method in order to evaluate the power of the Wilcoxon test?

Thank you!