A formal test for weak stationarity of spatial and spatio-temporal random fields is proposed. We consider the cases where the spatial domain is planar or spherical, and we do not require distributional assumptions for the random fields. The method can be applied to univariate or to multivariate random fields. Our test is based on the asymptotic normality of certain statistics that are functions of estimators of covariances at certain spatial and temporal lags under weak stationarity. Simulation results for spatial as well as spatio-temporal cases on the two types of spatial domains are reported. We describe the results of testing the stationarity of Pacific wind data, and of testing the axial symmetry of climate model errors for surface temperature using the NOAA GFDL model outputs and the observations from the Climate Research Unit in East Anglia and the Hadley Centre.