My money is on the photocell sensor, I don't think you can easily test one though.
I am pretty sure you have to remove the dash pad to get to that sensor.
I could not find a part number for this, but I did read where somebody said they went to Radio Shack and bought an assortment bag of CDS photocells, and used the large one to replace theirs, not sure if that would work for you, but if so it will be a lot cheaper than getting the part from a dealer, I'd try salvage yards before a dealer.
2006 Pontiac Grand Prix GT with SC
1996 Buick Park Ave NA