This paper addresses the problem of testing for the presence of a stochastic bubble in a time series in the case that the bubble is periodically collapsing so that the asset price keeps returning to the level implied by the market fundamentals. As this is essentially a problem of identifying the collapsing periods from the expanding ones, we propose using a generalization of the Dickey-Fuller test procedure which makes use of the class of Markov regime-switching models. The potential of the new methodology is illustrated via simulation, and an empirical example is given.