Asymptotically uniformly most powerful tests in parametric and semiparametric models