The simple answer to "Does stress-testing a spacecraft affect its durability?" is Yes, it does, in the classical western view of test programmes.
I can't answer for the James Webb Telescope specifics but a common approach is to divide a test programme conceptually into design verification and workmanship verification. As an aside, the design verification tests are called the "qualification" tests where as the workmanship verification tests are also known as "acceptance" tests.
Qualification tests are aimed at showing that the system works at some given range of environment and can survive at some greater range. These will all be the expected mission environment (temperature, radiation, vibration plus some margin, all for some given length of time). Acceptance tests are similar but with lower margins. The usual philosophy is that a flight model can not be subjected to qualification levels and so a special qualification model has to be built for the qual tests. This fits the usual serial production well, the qual model is tested hard but never flies, the flight models only see acceptance testing.
In the James Webb case the production is just one satellite and there may not be a qualification model at satellite level. In this case sometimes the mission management agree with their customer that the flight model will be tested to qualification levels of temperature and vibration stress but only for durations consistent with acceptance testing. This is called "proto-flight" testing and it explicitly recognises that testing affects durability.
As an aside I often think that protoflight testing is a bit of a fudge that both undertests for qualification purposes and over tests for acceptance (workmanship purposes), but that's just my tuppence.