The answer is that it depends. Much depends on your location, whether solar panels are prevalent in your area, leased as opposed to owned and the age of the system.
Justifying installation of these panels requires calculation of the expected energy output over the life of the system, it’s cost and it’s impact on reduction of your electrical bills. There are tools available to make these calculations (see pvvvalue.com).
As a real estate broker, i have found that many buyers are distracted by their appearance. It is difficult, given current technology, to provide enough savings without blanketing most of the back and sides of a home.
Moreover, many buyers are reluctant to take on the payment plan that goes along with these systems as most are financed.
Before making a purchase, decide if you will be in that home long enough to realize the benefit as it is a difficult sell in some markets. Ask a lot of questions before buying.