The AfD has spent years preparing to turn its first governing foothold into a proving ground.