$I=1$ and $I=2$ $\pi-\pi$ scattering phase shifts from $N_{\mathrm{f}} = 2+1$ lattice QCD