We consider two definitions of the power function which equivalence is unclear to me.
(1) The power function of a test, denoted by $Q(\theta)$ is the probability of rejecting null hypothesis $H_0$ when $\theta\in \Theta$ is the true parameter value. The power function is then given by $$Q(\theta)=P_\theta(\cal R).$$
We have obviously here $Q(\theta_0)=\alpha$ and $Q(\theta_1)=1-\beta$ where $\alpha$ is the I type error and $\beta$ is the II type error.
(2) A function $\psi(.):\cal X^n\to [0,1]$ is called the critical function where $\psi(\mathbb{x})$ stands for the probability with which the null hypothesis $H_0$ is rejected when the data $\mathbb{X}=\mathbb{x}$ has been observed, $\mathbb{x}\in \cal X^n$.
Why now, we can rewrite the power function defined in (1) as follows
$$Q(\theta)=E_\theta\{\psi(\mathbb{X)}\}$$ for $\theta\in \Theta$ ? Where comes the expected value under the true $\theta$ from?
$$P_\theta(\text{reject}) = E_\theta[1_{\text{reject}}] = E_\theta[E_\theta[1_{\text{reject}} \mid X]] = E_\theta[\psi(X)].$$