What is the purpose of long endurance test flights? Well known is the last long endurance test flight by a Boeing B787-8, which drew its shape in the air for 18 hours while on a long endurance test flight: https://www.wired.com/story/boeing-787-8-drawing-test-flight/. 

What exactly is the purpose of these long endurance test flights? What is tested, what shall be proven? - surely not that the aircraft can actually stay in the air that long, because that test flight happened long after the introduction of this type into the market...

On a side not, does every commercial airline type have to undergo such an endurance test flight?
This particular test flight tested the engines, not the aircraft:


  At 15:38 local time N7874, the fourth 787 built, departed Boeing Field
  in Seattle for an 18-hour, 22 state test flight. The crew spent the
  overnight hours above the United States performing ETOPS testing on
  the new Rolls Royce Trent 1000 TEN engine, which will power the
  787-10.


https://www.flightradar24.com/blog/boeing-uses-a-787-to-draw-a-787-dreamliner-during-etops-test/